Sprites selection

This forum is currently in read-only mode.
From the Asset Store
Selection Frame
$1 USD
80% off
Selection frame like in RTS games, works both on mobile and desktop devices.
  • 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

    <img src="http://dl.dropbox.com/u/10457408/Construct/ENG_FORUM/Help%26Support/Select/screenshot.jpg">

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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

    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.

  • 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.

    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.

    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.

    How come I've never tried that . I've always used that dumb paste new event, than erase method.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)