Layer interaction - I am confused
Hunnenkoenig
Member Posts: 1,173
I run into a problem today, which I did not experienced until now.
I have a background layer, where all my stuff is placed normally. Now I added an extra layer for an invisible actor, which does nothing else, just watch if the screen is touched or not (don't ask. In my case it makes sense :-P)
Now I have actors on the background layer and they have rules and use attributes of course and they worked all great.
Then I added 3 new actors and they didn't work, although they did pretty much the same, like the other actors.
I have tested and I did the following:
Added an actor to the background layer, which should rotate clockwise with speed of 90 if game.attribute.X is false (0) and move to direction 180 relative to actor, when game.attribute.X is true (1).
It worked in GS without problems, but when I used the viewer on the iPhone it did nothing.
Then I moved it to Layer1 (the touch watching layer) and suddenly it worked in the viewer too.
I then tried different things, like touch press rules etc and nothing worked on the background layer, but worked fine on the Layer1 in viewer.
Now I am confused, if layers have some strange rules, how they work, because I used different layers in other scenes too and I did not have this problem.
I have a background layer, where all my stuff is placed normally. Now I added an extra layer for an invisible actor, which does nothing else, just watch if the screen is touched or not (don't ask. In my case it makes sense :-P)
Now I have actors on the background layer and they have rules and use attributes of course and they worked all great.
Then I added 3 new actors and they didn't work, although they did pretty much the same, like the other actors.
I have tested and I did the following:
Added an actor to the background layer, which should rotate clockwise with speed of 90 if game.attribute.X is false (0) and move to direction 180 relative to actor, when game.attribute.X is true (1).
It worked in GS without problems, but when I used the viewer on the iPhone it did nothing.
Then I moved it to Layer1 (the touch watching layer) and suddenly it worked in the viewer too.
I then tried different things, like touch press rules etc and nothing worked on the background layer, but worked fine on the Layer1 in viewer.
Now I am confused, if layers have some strange rules, how they work, because I used different layers in other scenes too and I did not have this problem.
Comments
I've had some funny stuff happen when I have objects that move in a nonscrollable layer.
Also, I usually make a few different layers to help split stuff apart, it's helped me track down potential issues. For example:
controls
foregroundActors
Actors
backgroundActors
Background
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left