How to simulate a boundtolayout behavior?

Get help using Construct 2

Post » Tue Jun 04, 2013 2:12 am

i wanna use wrap in a sprite under certain conditions, but in others i want it to hit in a invisible wall. So, how boundtolayout works?
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Tue Jun 04, 2013 2:32 am

The "Bound To Layout" behavior acts something like this:

Set X to clamp(Sprite.X, 0, LayoutWidth)
Set Y to clamp(Sprite.Y, 0, LayoutHeight)

The clamp function will take the Sprite's X and Y positions and will limit them between 0 to layout's width and height, respectively. Changing the last two parts of those clamp functions will change the limits.Zero62013-06-04 02:33:51
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Tue Jun 04, 2013 3:52 pm

@Zero6 Is it a everytick
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Tue Jun 04, 2013 5:00 pm

It can be "Every tick" if you want to. That's probably what you would want though.Zero62013-06-04 17:00:31
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Tue Jun 04, 2013 5:07 pm

Solved, well done my friend. If there is anything i could help, send me a PM.
B
7
S
3
G
1
Posts: 154
Reputation: 1,812


Return to How do I....?

Who is online

Users browsing this forum: oosyrag, R0J0hound and 9 guests