Sprites selection

For questions about using Classic.

Post » Mon Jan 24, 2011 12:06 pm

I'm making a menu into a game and a have this problem with it. When I move the cursor over sprites faster, sometimes two or more sprites stays highlighted. It's same if I use change opacity instead of color filter. Move the cursor from first to last sprite and back. - FILE
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Mon Jan 24, 2011 1:20 pm

How about this? http://dl.dropbox.com/u/6660860/select.cap

Note: The order of events is important here, the mouse over event must come after the Always event.
B
7
S
2
G
4
Posts: 164
Reputation: 2,418

Post » Tue Jan 25, 2011 8:53 am

That works, thanks. Do you know why my example doesn't work? When I look at it, it tells me it should work, so why..

edit: one more thing - when I want to use else, I always add always event, than subevent with condition and else subevent to join them. Than I delete always to keep it nice :) Do you know how could I create it without creating always(or whatever event) and then deleting it?
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Tue Jan 25, 2011 9:05 am

Basically what i think is happening is that if you move your mouse over them fast enough, the cursor can hit more than one of them in a single tick, so then on the next tick, it checks to see if your mouse is over "Sprite" which is true, so the else condition doesn't get called, hence why they stay highlighted.

So lets say i quickly move my cursor from the first sprite to the second in a single tick, then on the next tick it says 'Is mouse over sprite?" which will come out as true, since my mouse is on the second sprite, so it won't call the else condition.

I hope that makes sense, but its just a wild guess and I'm most likely completely wrong :D

Edit to answer your edit: As far as i know, your not meant to make else events sub events, an else event will always attach itself to the condition directly above it.
B
7
S
2
G
4
Posts: 164
Reputation: 2,418

Post » Tue Jan 25, 2011 12:08 pm

[quote="Citnarf":12vqtu5y]Basically what i think is happening is that if you move your mouse over them fast enough, the cursor can hit more than one of them in a single tick, so then on the next tick, it checks to see if your mouse is over "Sprite" which is true, so the else condition doesn't get called, hence why they stay highlighted.

So lets say i quickly move my cursor from the first sprite to the second in a single tick, then on the next tick it says 'Is mouse over sprite?" which will come out as true, since my mouse is on the second sprite, so it won't call the else condition.[/quote:12vqtu5y]

This could explain it, still I thought that cursor position is refreshed every tick so on next tick it should be changed, but it probably keeps the cursor's coordinates until the next mouse move.

[quote="Citnarf":12vqtu5y]
Edit to answer your edit: As far as i know, your not meant to make else events sub events, an else event will always attach itself to the condition directly above it.[/quote:12vqtu5y]

How come I've never tried that :oops: . I've always used that dumb paste new event, than erase method.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests