SPUDevelopers / Naturalize

A Cocos2d-x turn based strategy game.
Other
11 stars 7 forks source link

Research layer support #17

Open Isaac-W opened 9 years ago

Isaac-W commented 9 years ago

Cocos2d has support for a mechanic called "layers". Supposedly, this would be overlayed on the screen and receive input. We could use this to implement the "Select Unit Action..." menu, instead of treating it as a game state.

Need to look into how to implement Layers and if they are a viable alternative to game states.

Isaac-W commented 9 years ago

After some initial research, yes, these are exactly what we're looking for. Basically, layers sit on top of each other and input from the event handlers will trickle down each of them until they are consumed. So, this would work for our little actions menu, as well as a pause screen, and possibly even our waiting state (to block input temporarily).

More research is needed to determine exactly how to use Layers in the code.

Isaac-W commented 9 years ago

Well, according to the Cocos2d-x docs, Layers have been deprecated... (T^T) The docs say that Layers are not exclusive in receiving input, as Nodes can also receive input. Now, we need to determine how to get Nodes to receive and consume input so that we can implement things like a menu.