How to..

For questions about using Classic.

Post » Sat Jul 18, 2009 12:36 am

Hi,

I have 2 objects on a layout: a player and a mouse pointer sprite.

The player and the mouse pointer sprite both have the "center view on me" setting.

So the view tries to keep both the player and the mouse pointer on it.

But it havn't limits: if I want my game on a window, when the mouse go out of it, the view center on the mouse pointer and the player is out of the view.

How can I limit the movement of the mouse by a certain range?
B
2
S
1
G
3
Posts: 193
Reputation: 1,486

Post » Sat Jul 18, 2009 12:54 am

Try limiting the pointer's movement so it doesn't leave the screen. You can do that with clamp(), like so:

[code:1adijlf3]
+ Always
-> Pointer: Set X to clamp(MouseX, ScrollXLeft, ScrollXRight)
-> Pointer: Set Y to clamp(MouseY, ScrollYTop, ScrollYBottom)
[/code:1adijlf3]
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Jul 18, 2009 9:58 am

Thank you deadeye, it works. :)
B
2
S
1
G
3
Posts: 193
Reputation: 1,486

Post » Thu Sep 24, 2009 6:17 pm

bumped because its been [solved]. for better search.

"center view on me" objects game window.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Thu Sep 24, 2009 8:00 pm

it's probably not a good idea to keep bumping old thread's because they are solved
it shouldn't really make a difference in searching
almost all old threads are solved.
if you want to post solutions in a useful way, try making wiki articles or posting to the tutorials section
I'm not a mod...but, I'm probably not the only one who doesn't want to see old posts when I see a forum has new posts on it
know what I mean? :wink:
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Sep 24, 2009 8:14 pm

yea, try not to bump old threads. And what do you mean for better search? This thread will just migrate back down when new ones are posted, so it doesn't make sense to bump it to keep it visible.
[quote="manontherun":nyzyx4x6]"center view on me" objects game window.[/quote:nyzyx4x6]
sorry I really don't get the meaning of this.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Sep 24, 2009 8:38 pm

actually last time i had to search for something it went into 30+ pages. thats happened more than once and many are actually not solved btw. some questions come up repeatedly because of hard to find solutions. :D you are right tho.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Fri Sep 25, 2009 1:44 am

We should make a pinned topic in here with a list of FAQ, with links to threads so you don't have to rely on the 'search' thing only.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest