How do I set x and y instance in a plugin?

Get help using Construct 2

Post » Mon Dec 12, 2016 4:22 pm

I got the instance, i change the x and y, but in the game, the sprite dont change... why?

Code: Select all
inst.x = newX;
inst.y = newY;


If i see in debug, the sprite x and y change, but i cant see at the canvas... why?
B
14
S
6
G
2
Posts: 81
Reputation: 2,241

Post » Mon Dec 12, 2016 4:23 pm

Where are the newX and newY values coming from?
B
20
S
8
G
3
Posts: 458
Reputation: 4,055

Post » Mon Dec 12, 2016 4:28 pm

mekonbekon wrote:Where are the newX and newY values coming from?


don't worry, the code is correct, it is a function... when i debug in chrome i have the x and y, when i debug in construct, the x and y change, but don't redraw.
B
14
S
6
G
2
Posts: 81
Reputation: 2,241

Post » Mon Dec 12, 2016 4:43 pm

I got it!
I miss:

inst.set_bbox_changed()
B
14
S
6
G
2
Posts: 81
Reputation: 2,241


Return to How do I....?

Who is online

Users browsing this forum: Anna Nehves Br, divsyntax, oosyrag, volumetv and 16 guests