sistemlogikadigital Posted January 6, 2019 Share Posted January 6, 2019 currently im using method setRegion to change frame on GUI_Object, but i want change it like Entity using setCurrentAnimation. this.renderable = game.texture.createAnimationFromName(imgNames); this.renderable.addAnimation ("on", [0]); this.renderable.addAnimation ("off", [1]); this.renderable.setCurrentAnimation("on"); When i run this code on GUI_Object i got an error. So how to achieve this on GUI_Object ?? thanks Quote Link to comment Share on other sites More sharing options...
obiot Posted January 7, 2019 Share Posted January 7, 2019 GUI object are just extending the me.Sprite object, so assuming you pass the right argument to the constructor, it should be working. Can you share how you instantiate your object ? if you pass game.texture for the image setting parameter it should do the trick. Quote Link to comment Share on other sites More sharing options...
sistemlogikadigital Posted January 7, 2019 Author Share Posted January 7, 2019 here is my code, i only know this, dont know how to add animation this._super(me.GUI_Object, "init", [ posX,posY, { image : game.texture, framewidth : imgWidth, frameheight : imgHeight, region : imgNames[0], }]); Quote Link to comment Share on other sites More sharing options...
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.