Balamurugan Posted July 7, 2018 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. Link to comment Share on other sites More sharing options...
Balamurugan Posted July 11, 2018 Author Share Posted July 11, 2018 ANYONE THERE ?????? Link to comment Share on other sites More sharing options...
Tom Atom Posted July 11, 2018 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 Link to comment Share on other sites More sharing options...
bossikkk Posted July 11, 2018 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 Link to comment Share on other sites More sharing options...
Balamurugan Posted July 12, 2018 Author 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. Link to comment Share on other sites More sharing options...
prob Posted July 12, 2018 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. Link to comment Share on other sites More sharing options...
Balamurugan Posted July 14, 2018 Author 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? Link to comment Share on other sites More sharing options...
Recommended Posts