2D Toolkit Forum

2D Toolkit => Support => Topic started by: aaron7090 on November 04, 2013, 01:17:31 am

Title: center sprite
Post by: aaron7090 on November 04, 2013, 01:17:31 am
Is it possible to center a button or sprite inside a uilayout with no code? Also if this is possible is it possible to center + offset?
Title: Re: center sprite
Post by: unikronsoftware on November 04, 2013, 12:58:31 pm
Create a game object, add a sprite as a child to that game object.
In the uilayout, set the game object anchors to all 4 sides. That will centre the game object, and indirectly the sprite underneath it. If you need to offset the sprite, simply move it, independently to the child.
Title: Re: center sprite
Post by: aaron7090 on November 05, 2013, 04:12:39 am
it worked, thanks!  :D