How do I Set Sprite Potitions with Events?

Get help using Construct 2

Post » Mon May 16, 2016 5:59 pm

For the life of me I just cannot get this to work.

After dragging the sprites to the layout and specifying the correct layer for them, I tried to set an event in the event sheet to set the sprites in their correct positions:
System event, on start of layout, sprite_X, set position to (X,Y)

But it does nothing, the sprite stays firmly in the place that is in its common properties.

What am I not getting here? Clearly I'm an absolute beginner, so please be gentle.

Obviously I also missed the Beginner's Questions section of this forum, where I should have posted this. First impressions, and all..
B
4
Posts: 4
Reputation: 200

Post » Mon May 16, 2016 6:15 pm

That should work so there must be an error with the event. Please link to a screenshot or project file of some kind and this can easily be resolved.

Also just a guess from not seeing the project, you seem to want to set the position of multiple sprites but probably only have a single instance on the event sheet so my guess is that a single sprite is just moving around and then hits the final position you set. You need to create multiple sprites and set their positions accordingly, depending on what you want to happen of course. You may have set this up correctly though and there are other errors, it's hard to assist with guess work.
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Mon May 16, 2016 6:33 pm

Thank you for the reply. I have taken a screenshot of the eventsheet in question.

Image

There are five sprites supposed to be on the screen and arranged by the event. In their properties they are manually arranged in the center orizontally and spaced out vertically.

This event supposedly placing them in the top corner, and one in a random place does nothing when I run the project. They are all still in their manually set places.
B
4
Posts: 4
Reputation: 200

Post » Mon May 16, 2016 6:42 pm

Do you have events that move them back to their original positions later on in the project? I'd have to see the .capx file I think because this looks fine to me. Provide a cut down version if you can showing the issue, via dropbox or something similar.
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Mon May 16, 2016 6:47 pm

There is nothing regarding these sprites besides this, there is only a title screen before this, and these sprites are not even on it. And the mouse click basically just reloads the menu screen at this point.
B
4
Posts: 4
Reputation: 200

Post » Mon May 16, 2016 6:54 pm

Is your layout pointing to the correct event sheet?
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Mon May 16, 2016 7:02 pm

blackhornet wrote:Is your layout pointing to the correct event sheet?

We have a winner here. The embarrassment is real.

I did not even notice this, I assumed the event sheet created while making the layout would be linked automatically. At least I recall creating the sheets with layouts.

Thank you very much to both of you for spending time on this.
B
4
Posts: 4
Reputation: 200

Post » Mon May 16, 2016 7:05 pm

Ah yes, might've noticed that with the project. Well done for guessing that :P
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests