Hi, I’ve been using the browser’s “alert” function for displaying data to the player, but it’s come a time in my project that I need something better, so I thought of displaying a message within the game, naturally.
The approach I thought of consisted in:
# Create a cc.LayerColor with opacity so that the game is partially hidden (note also that this layer should swallow all inputs and that the game itself should be paused while the message is shown)
# Draw a colored sprite in the center of the screen for better viewing the message’s text
# Show the message as a LabelTTF
# Show an “OK” button
Sadly, I’ve encountered a few problems:
* I can’t make the layer have an opacity and color (I’m using
cc.c4b(0,255,0,123) which in another application of mine works fine)
* I don’t know how to pause the game (nor how to make it resume when the button is activated)
* I don’t know how to make the layer “swallow” all inputs so they don’t propagate to elements below the layer
Here’s my (currently broken, you just neeed to walk upwards to the first “portal” to see what I currently have going on) project: http://proto.heart-bit.com.ar/laberinto_broken
The project moment’s prior to trying to implement this new feature (minus a few tweaks in other parts of the code) is here for comparison: http://proto.heart-bit.com.ar/2013_11-laberinto
Am I re-inventing the wheel here? Is there a better (and quicker and easier) way to do this? Like with CocoStudio or some other way?