Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Change Parents Class methods — Gideros Forum

Change Parents Class methods

amaximovamaximov Member
edited March 2013 in General questions
Hi,

I have a class I use for a spaceship that inherits from Sprite. I call methods like setRotation() on it. However, I really wish I could call setRotation() but include some of my own code into that method. I realize I can do this, but this does not work because it simply overrides the setRotation() method.
 
spaceship = Core.class(Sprite)
 
function spaceship:init()
 
end
 
function spaceship:setRotation()
      -- SOME EXTRA CODE
      -- HOW DO I ACTUALLY ROTATE THE SPRITE FROM WITHIN THIS FUNCTION?
end
How would I actually rotate the sprite from within that method? I have seen some posts related to this but did not really understand them. Help would be very appreciated. Thanks!

Comments

Sign In or Register to comment.