Expecting BoundToLayout with Touch dragging sprite

Bugs will be moved here once resolved.

Post » Sun Jan 08, 2012 1:16 pm

Hi,

What I'm trying out is to move around, with Touch input,
some sprites that have BoundToLayout behaviour.
However the sprite can be moved out of the canvas.

Here is the capx file:
http://dl.dropbox.com/u/50903604/Construct2/touch_drag_bound_layout.capx

I'm new to Construct2 so maybe I did not get it right.
Or BoudToLayout behaviour can only be used with other preset behaviour maybe ??

Thanks in advance for your help
B
3
Posts: 2
Reputation: 379

Post » Sun Jan 08, 2012 6:58 pm

Try
is in touch set position to clamp(touch.x,0,yourscreenwidth), clamp(touch.y,0,yourscreenheight)

If it goes beyond with that in place then there's definitely a bug somewhere.
Image ImageImage
B
169
S
50
G
169
Posts: 8,286
Reputation: 108,216

Post » Sun Jan 08, 2012 7:46 pm

Thanks for the hint,
I missed the clamp function in a first run.

I finally used something like
clamp(Touch.X, Sprite.Width/2, LayoutWidth-Sprite.Width/2)

to act like BoundToLayout bound by Edges

I will go on with my toying with Construct2, thanks again
B
3
Posts: 2
Reputation: 379

Post » Sun Jan 08, 2012 8:27 pm

@wiibaa: you might consider taking a look at the system expressions (like clamp and other usefull stuff).
This might help you with your toying/discovery
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Mon Jan 09, 2012 10:52 am

I've fixed BoundToLayout to work in this case for the next build.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests