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 Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

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
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon Jan 09, 2012 10:52 am

I've fixed BoundToLayout to work in this case for the next build.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests