strange display problem
by Zeinad · in iTorque 2D · 04/17/2009 (12:30 pm) · 3 replies
I just got my dev stuff set up on the iPhone end and can now get my game on my iPhone (yay!), however I ran into a problem and I am at a loss on how to fix it.
When I run the game on the computer everything is fine.
When I run it on the simulator things move as they are directed, however there are some really weird display issues, and play issues. When I start the game, the menu screen doesn't go away, the images I have are placed on top of it. Then when the images move they leave a trail behind them. When I press buttons that on the computer make the player image move it stays in place, but it plays the movement animation and it does flip as if it were moving when I try to move the other way, it just doesn't move. Other images do move though, just not the player.
When I put it on the phone, nothing moves at all, although the player behaves the same as he does on the simulator. Other objects just stay where they load up, the menu screen is still the background though.
Any thoughts on what could cause this or how to fix it?
When I run the game on the computer everything is fine.
When I run it on the simulator things move as they are directed, however there are some really weird display issues, and play issues. When I start the game, the menu screen doesn't go away, the images I have are placed on top of it. Then when the images move they leave a trail behind them. When I press buttons that on the computer make the player image move it stays in place, but it plays the movement animation and it does flip as if it were moving when I try to move the other way, it just doesn't move. Other images do move though, just not the player.
When I put it on the phone, nothing moves at all, although the player behaves the same as he does on the simulator. Other objects just stay where they load up, the menu screen is still the background though.
Any thoughts on what could cause this or how to fix it?
About the author
#2
When I go to put it on the phone though, things are almost exactly the same as before. There were a few things that had been moving that stopped, but everywhere I touch the screen the mouse cursor has that same residual image effect as before, and the main menu is behind the game just like before. The player still cant move and the animations for moving still play fine.
04/20/2009 (8:13 am)
That was definitely a step in the right direction, on the simulator I have things working pretty well (not quite everything, but most things). The trailing has stopped and I can move my player around, although a lot of other things aren't moving even with the setUsesPhysics(true) being run for them.When I go to put it on the phone though, things are almost exactly the same as before. There were a few things that had been moving that stopped, but everywhere I touch the screen the mouse cursor has that same residual image effect as before, and the main menu is behind the game just like before. The player still cant move and the animations for moving still play fine.
#3
The background image still doesn't display however, just a black screen, is this a side effect of "GuiBlackContentProfile" and is there an option that will let me use a background but also have things work properly?
04/20/2009 (8:33 am)
Nevermind... it now seems to be working fairly well on the phone also! No idea what we did to fix it though...The background image still doesn't display however, just a black screen, is this a side effect of "GuiBlackContentProfile" and is there an option that will let me use a background but also have things work properly?
Torque Owner Ronald Ian Bantayan
Make sure your main parent GUI has "GuiBlackContentProfile" set. Otherwise, you'll experience the 'infinite mirrors' effect that you're seeing.
%guiContent = new GuiControl(mainScreenGui) { canSaveDynamicFields = "0"; isContainer = "1"; Profile = "GuiBlackContentProfile"; HorizSizing = "width"; VertSizing = "height"; Position = "0 0"; Extent = "480 320"; MinExtent = "8 8"; canSave = "1"; Visible = "1"; hovertime = "1000";As for the sprites not moving, Garage Games did optimizations for the iPhone (PAUP_OPTIMIZE to be exact) that disables object physics by default. To enable physics, you have to call the boolean function Or:
function enablePhysics(%this) { %this.setUsesPhysics(true); }And then assign your object the class "enablePhysics" in level builder (or just inject the code above in an existing class function.)Hope this helps!
- Ronald