Balamurugan 0 Posted July 7, 2018 Report Share Posted July 7, 2018 I want to show winning animation in my game. Like this Image. I have 4 text like star- 3500 , best - 20548 , coins - 100 and diamonds - 35. i don't know how to handle this situation. Please give any reference how to handle this type of tween. And also how to merge the 4 text into sprite and make tween. please tell what are the possible ways there. Please share your experience. Quote Link to post Share on other sites
Balamurugan 0 Posted July 11, 2018 Author Report Share Posted July 11, 2018 ANYONE THERE ?????? Quote Link to post Share on other sites
Tom Atom 269 Posted July 11, 2018 Report Share Posted July 11, 2018 You will never handle this with single game object. You have to build your own complex game object with other game objects. Split it into atomic objects that are present in Phaser. Then build up. For example, Phaser has Sprite and BitmapText - these are atomic for you. Create new class extending Phaser Container, put Sprite and BitmapText into it and you have new game object element "Sprite with text" ... so you can, for example, make: "* 3500" Then create buttons and any other elements you need and finally create WinDialog (again extending Phaser Container) and compose it from your basic elements. You can then tween whole dialog (like pop) or tween any individual elements. BTW, dialog like this is lot of work. Do not expect single function or game object to do all the work for you...On the other hand, if you make your elements good, then you can reuse it for other dialogs (and even outside of dialogs) in game - like "Sprite with text" in game HUD Balamurugan 1 Quote Link to post Share on other sites
bossikkk 1 Posted July 11, 2018 Report Share Posted July 11, 2018 You can tween the sprites with the text, just add the text to targets and setting coordinates. Example: http://labs.phaser.io/edit.html?src=src\tweens\multiple targets.js Balamurugan 1 Quote Link to post Share on other sites
Balamurugan 0 Posted July 12, 2018 Author Report Share Posted July 12, 2018 16 hours ago, Tom Atom said: You will never handle this with single game object. You have to build your own complex game object with other game objects. Split it into atomic objects that are present in Phaser. Then build up. For example, Phaser has Sprite and BitmapText - these are atomic for you. Create new class extending Phaser Container, put Sprite and BitmapText into it and you have new game object element "Sprite with text" ... so you can, for example, make: "* 3500" Then create buttons and any other elements you need and finally create WinDialog (again extending Phaser Container) and compose it from your basic elements. You can then tween whole dialog (like pop) or tween any individual elements. BTW, dialog like this is lot of work. Do not expect single function or game object to do all the work for you...On the other hand, if you make your elements good, then you can reuse it for other dialogs (and even outside of dialogs) in game - like "Sprite with text" in game HUD Please send any reference link or any code sample. Thank you so much for your response. And also i check your phaser timer based game pirates the match. In this game if i minimize the window, timer is stopped. I also try this scenario timer is stopped when i minimize window. Its great drawback in browser. i dont know this pblm is in browser or phaser. Any Idea, about window minimize game is paused. how to prevent game pause when minimize browser window. Quote Link to post Share on other sites
prob 26 Posted July 12, 2018 Report Share Posted July 12, 2018 There is a large collection of running code samples here you can reference. The browser (any browser) stops updating tabs when it is minimized. Quote Link to post Share on other sites
Balamurugan 0 Posted July 14, 2018 Author Report Share Posted July 14, 2018 On 7/12/2018 at 8:24 PM, prob said: There is a large collection of running code samples here you can reference. The browser (any browser) stops updating tabs when it is minimized. @prob Any solution there for browser stop updating? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.