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

Get help using Construct 2

Post » Thu Feb 19, 2015 12:31 pm

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!
B
10
S
1
Posts: 72
Reputation: 1,017

Post » Thu Feb 19, 2015 2:31 pm

Doesn't putting the origin point in the center of each animation/animation frame work?
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Thu Feb 19, 2015 2:34 pm

from start place image point to centre that is all you need
B
226
S
31
G
14
Posts: 1,899
Reputation: 38,302

Post » Thu Feb 19, 2015 10:14 pm

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.
B
28
S
8
G
4
Posts: 767
Reputation: 5,950

Post » Fri Feb 20, 2015 1:06 am

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! :D
B
10
S
1
Posts: 72
Reputation: 1,017


Return to How do I....?

Who is online

Users browsing this forum: fierce25 and 9 guests