Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
setPosition of a Sprite containing other Sprites — Gideros Forum

setPosition of a Sprite containing other Sprites

andybarillaandybarilla Member
edited March 2012 in General questions
This is in regards to my TextArea sprite I created in this message (http://www.giderosmobile.com/forum/discussion/654/text-block-sprite) but it is relevant to any sprite containing other sprites so I figured that I would ask it as a separate question.

For cases in which I have multiple lines of text which is created as a sprite containing multiple TextFields and I setPosition it sets the position purely based off the first sprite.

Is there a way to either:
- manually change the anchor position of the sprite
- have the anchor position adjusted to be the center of the sprite
- overload the setPosition function in my sprite so that I can make the adjustments myself and then call the base class with the modified routine

For now, I'll manually make the adjustments but I was hoping for a more all purpose way of doing this.

Comments

  • Bit of a bug-bear with me that we can't set the anchor position on sprites by default. If you can't overload the setPosition function, just sub-class sprite, add in your new routines and use that as your new sprite class instead of the default.
Sign In or Register to comment.