Help On Actor Extending

Hi all,

So I have a actor, when it's pressed, the actor's size increase. Problem is, the actor extend in BOTH sides. I need the actor to extend in only one direction, for example a frog actor extending its tongue, another actor. Any help would be very appreciated.

When touch is pressed,
Change attribute : self.size.height to self.size.height +20.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Why are you changing the size of the frog actor if you have a separate tongue actor?

    To answer you question, GameSalad measures actor heights (and widths) from the center outward. So an actor of height 50 is 25 pixels from the center on both edges. Adding 20 will actually add 10 to each edge, thereby making the height 70 or 35 pixels from the center on both edges. It's possible to resize an actor and have it stay in place by changing or constraining the y position to y+heightIncrease/2. In your case, self.position.y+10.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Game_AppAdGame_AppAd Member Posts: 10
    Hi tatiang,

    Thank you very much for replying. Actually i am trying to make an actor to stretch or expand when button is pressed. Just like frog extend its tongue to catch flies when button is pressed. Can you please enlighten me how to go about it?

    Thank you very much again.
Sign In or Register to comment.