• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Draw from bottom left

9Ate7

Newbie
i am working with sprites, and i ran into a little problem, the sprites are different sizes, so when i am drawing on the canvas, it draws below the given point. I have multiple animations ex: Stand, swing, Run. The size of the sprites is constant through the type of animation, (all pictures in Stand are the same size) but they are not the same as other pictures, like Run. I am wondering if there is a way to draw from the bottom left corner of the picture as opposed to top left, because the feet remain at the same location for the most part.
 
No, Canvas uses the top left and there is no way around this. If you use OpenGL, however, it uses the bottom left as its reference point. With that said, you should really be designing your sprites so that all animation sequences are the same size. In fact, you should be using a single sprite sheet to contain all of the various frames of all of the various animations and then only render a single part of the sprite sheet (containing the frame you want to render) at any given time.
 
Back
Top Bottom