Access to sprite position property


Right now I can only control the scale of a sprite. I want to set the position of a sprite, both directly and with animation.


go.animate("#sprite_pusher", "position.y", go.PLAYBACK_ONCE_PINGPONG, 20, go.EASING_INQUAD, 1)


The way to currently go is to put the sprite component in a game object. That gives you the full range of runtime movement, rotation and scale possibilities.


Hello @sicher

I don’t know how engine works internally , so i don’t know why scale property is accessible and in the other hand position is not. Also there is a position property for sprites on editor’s property panel, i can set manually sprite position within gameObject’s space.

But good thing is; it works how you offer to handle this situation.

*Pros : Dont know yet. Maybe learn benefits in future.

  • Cons : You have lots of gameObject around.

Best Regards,


As long as the game objects don’t have scripts associated with them, the extra runtime cost is not high.


What if I have several sprites, do I need a game object for each sprite? I want to animate each sprite separately.


Yes, that would require one game object per sprite then. This is perfectly fine and how the engine is designed and supposed to work.


Yup, I’m doing that, is there a way to group game objects?


Yes, you can child a game object to a parent game object. You can do it in the editor while in a collection by drag and dropping a game object on another in the Outline. At runtime you do it via the set_parent message


Why is it not possible to allow setting position of a component with go.set_position()? It’s individual position can be set in the editor, but not in the code, why?


I’ll let @Johan_Beck-Noren or @sven answer this one.


Looking forward to seeing their reply.