Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Hotspot Animations  (Read 3560 times)

0 Members and 1 Guest are viewing this topic.

noxis

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 32
  • Noxis Interactive
    • View Profile
    • Noxis Media
Hotspot Animations
« on: March 26, 2007, 03:31:50 PM »

I have a title menu in the game, and when you move the mouse cursor over the "NEW GAME" entity, how do I make it activate an animation when you put the mouse cursor over it, and then when mouse cursor is not on it, reverse the animation.

The animation is a slight zoom in on the text, and then zooms back out when the cursor is not on it.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Hotspot Animations
« Reply #1 on: March 26, 2007, 05:24:57 PM »

You didn't say how your menu is done. But I'll suppose it's not an ordinary window (because it's pretty straightforward to assign hover images to buttons), but it's made of entities, right? In that case see this thread for an example of how to change entity sprite on mouse over.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

noxis

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 32
  • Noxis Interactive
    • View Profile
    • Noxis Media
Re: Hotspot Animations
« Reply #2 on: March 27, 2007, 03:39:36 AM »

I did that and when the cursor was over the hotspot it kept looping the first frame over and over again, until i moved the cursor away from the image it would go through the whole animation.  I would display the code but I'm not at home at the moment.  Actually I'll try to remember it off the top of my head

on "MouseEntry"
{
  newgame.SetSprite("sprites\menu\newgame_zoomin.sprite");
}

on "MouseLeave"
{
  newgame.SetSprite("sprites\menu\newgame_zoomout.sprite");
}


Also when I make the initial entity of the "new game" and I have to attach a sprite to it, should I make a one frame animation of the first frame?  So it doesn't automatically when the screen loads.


Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Hotspot Animations
« Reply #3 on: March 27, 2007, 11:53:35 AM »

Your newgame_zoomin.sprite is probably set as looping animation. Uncheck the "Looping" check-box in SpriteEdit and it should work ok.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.038 seconds with 21 queries.