
Looking for Cocos2D-X Popup Example for Score
Looking for Cocos2D-X Popup Example for Score
Hello, in the Cocos2d-X IOS example for the PlanetCuteRUBELayer demo, How do you make a popup show how many coins were collected? Any help is greatly appreciated! Thanks 

Re: Looking for Cocos2D-X Popup Example for Score
I guess you could make a body that starts off-screen, with the popup dialog image on it. Then you could move the body onto the screen when it needs to be shown. Loading and displaying text for the numbers is not something that RUBE can help you with, but you could use RUBE to lay out the position for where the text should go.
Re: Looking for Cocos2D-X Popup Example for Score
Goal: To have 3 stars and a dialog box show up at the end of each level
Are you saying to have all the stars and dialog off screen and then add the text? If so how do I show the totals since this off screen approach is all using static images and text.
Thanks
Are you saying to have all the stars and dialog off screen and then add the text? If so how do I show the totals since this off screen approach is all using static images and text.
Thanks
Re: Looking for Cocos2D-X Popup Example for Score
Is there a full game example with Rube that has the levels and scores for each level just like cut the rope?
Re: Looking for Cocos2D-X Popup Example for Score
Yes, you can move things around using SetTransform for the body that the dialog image is attached to. This would be in a separate layer to the main game world, so it can be made to stay in the same place on the screen even when the main game world moves. You have probably seen it already, but just in case I will give this link which shows an example of this using cocos2d: https://www.youtube.com/watch?v=JaHpmLN8DQA
Like I said, RUBE cannot help you with loading text, but cocos2d makes it very easy to make a sprite with some text on it. Then you can set the position and scale of that sprite based on something in the RUBE scene. In the past I have used a fixture to lay out the position for where I want the text sprite to go. The fixture does not get displayed, it is only used as a position marker.
Like I said, RUBE cannot help you with loading text, but cocos2d makes it very easy to make a sprite with some text on it. Then you can set the position and scale of that sprite based on something in the RUBE scene. In the past I have used a fixture to lay out the position for where I want the text sprite to go. The fixture does not get displayed, it is only used as a position marker.
Re: Looking for Cocos2D-X Popup Example for Score
That makes sense, would be great to add to the demo if possible. Thanks!