How do I change the origin image point during run time?

0 favourites
  • 5 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Hey all,

    Sorry to be pestering with multiple posts, but I was wondering if there is a way to dynamically change where an origin point is during run time. My sprite object changes size and dimensions a lot, and I need to somehow keep the origin point at the centre of the image during all of these changes, so that the sprite remains correctly possitioned in the layout. The problem is though, I have no idea how to do it! XD

    Thanks in advance for any help you can give!

  • Doesn't putting the origin point in the center of each animation/animation frame work?

  • from start place image point to centre that is all you need

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Import and do all of thescaling you need to do first.

    Then find the 1 frame that has the point you want in common with all the other frames. Set the origin point where you want it, then on the "Origin sub panel" right click and select "apply to all frames".

    It should put the origin in the same spot for all frames. It usually takes scale into account if I remember correctly. Just make sure you do all of the image adjustments first before you set the center.

  • The problem with using that method though is that I'm using the browser to allow the user to choose an image from their storage, which is then opened as a sprite.

    Although the way you solution reads, it may still work, actually. Thanks for your help all!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)