move inside and on edge of circle

Get help using Construct 2

Post » Fri Sep 28, 2012 9:13 pm

Fabulous R0J0hound
is this possible with a rounded rectangle as the limit ?kantin2012-09-28 21:14:23
B
23
S
12
G
4
Posts: 31
Reputation: 4,591

Post » Fri Sep 28, 2012 10:09 pm

same thing , @kantin
just make a invisible wall around ..
B
35
S
16
G
16
Posts: 2,223
Reputation: 16,601

Post » Fri Sep 28, 2012 11:37 pm

Thank ou kbdmaster
yes, but rounding is fluid with the technical R0J0hound
B
23
S
12
G
4
Posts: 31
Reputation: 4,591

Post » Sat Sep 29, 2012 7:46 pm

You can make a normal rectangle the limit with clamp():
set position clamp(self.x, left,right), clamp(self.y, top,bottom)

So to do a rounded rectangle as the limit do something like this:
1. limit to a rectangle first
2. check if object is in a corner of the rectangle.
3. if it is then limit it to a circle of that corner.
B
84
S
27
G
70
Posts: 4,933
Reputation: 49,558

Post » Wed Nov 07, 2012 1:44 pm

How would this work with a touched object instead of keyboard.

UPDATE:
Never mind I figured it out.

constrain_to_circle_touch.capxbon4ire2012-11-07 16:21:18
B
31
S
6
G
4
Posts: 160
Reputation: 5,998

Previous

Return to How do I....?

Who is online

Users browsing this forum: Myrmex, SnipG and 1 guest