object centre pivot

Started by plebeo, Tue 13/02/2007 19:07:35

Previous topic - Next topic

plebeo



I need to animate object.

So I write:

  object[1].SetView(view, loop);
  object[2].Animate(loop, delay, eOnce, eNoBlock);

when I see the preview of the view there is a option called "centre pivot".
I need to animate in this way but I don't know how.
How can I do? 




Ashen

I don't think that option has any effect on Objects, since their coordinates are based on the bottom left corner of the sprite, not the centre as with Characters. For Objects, I think you just have to make all the sprites in the Loop the same width (add transparent pixel 'padding' to any that need it so they're as wide as the widest), and position the object slightly (half the width of the sprite) left of where you want the 'centre pivot'.

And about that code: Are view, loop and delay variables you've set somewhere else or just pseudocode you're posting here? Obviously, they need to be the actual values of the View, Loop and Delay you want. Why are you setting the View for object 1, but animating object 2? Unless you've called object[2].SetView somewhere earlier in the script (but in the current room), that's likely to cause an error (you can't animate an Object that doesn't have a view set).
I know what you're thinking ... Don't think that.

Khris

The centre pivot option allows to view character anims properly, i.e. as they'll appear in-game.

With objects, you've got to make sure the sprites align properly, as there's currently no way to change an object's pivot.
Objects are positioned using their bottom-left corner, so keep this in mind when cropping the sprites.

plebeo

tahnks guys!!
I follow your suggests!!

SMF spam blocked by CleanTalk