mouseover doesn't always work...

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

mouseover doesn't always work...

Postby jack8135 » Tue Jun 19, 2012 8:37 am

I have created a menu with buttons and using Keyguard I want the buttons to light up when you hover over them with the mouse cursor. I figured out how to do that by stacking 2 hotspots and have one a button (hover zone) and another to display the lit up image but my problem is it doesn't always work. Especially when I move the mouse around quickly, it will only light up some of the time. I am not the best with code and I have a feeling that is why I'm not getting the results I want but I was wondering if anyone else has experienced this or if someone can help me code this more efficiently.

Here is the code for the Frame Properties:
Code: Select all
'Clear hotspots for this frame
Component("KeyGuard").Object.ClearHotSpots

'Hotspot definitions for buttons
Component("KeyGuard").Object.DefineHotSpot 0,0,640,62,1,0
Component("KeyGuard").Object.DefineHotSpot 206,125,230,50,11,0
Component("KeyGuard").Object.DefineHotSpot 206,185,230,50,13,0
Component("KeyGuard").Object.DefineHotSpot 206,245,230,50,15,0
Component("KeyGuard").Object.DefineHotSpot 206,305,230,50,17,0


'Hotspot definition for main image
Component("KeyGuard").Object.DefineHotSpot 0,0,640,62,2,0
Component("KeyGuard").Object.DefineHotSpot 206,125,230,50,12,0
Component("KeyGuard").Object.DefineHotSpot 206,185,230,50,14,0
Component("KeyGuard").Object.DefineHotSpot 206,245,230,50,16,0
Component("KeyGuard").Object.DefineHotSpot 206,305,230,50,18,0


and here is the code for VBS Procedures
Code: Select all
Sub KeyGuard_MouseEntersHotSpot(HotspotTAG)
   'MsgBox "Mouse enters hotspot area: " & HotspotTAG(0

If Action.GetCurrentFrameName = "1. Main" Then
      If HotSpotTag(0) = 1 Then Action.LoadAPicture Hotspot(2), "interface 3.gif"
   End If
If Action.GetCurrentFrameName = "1. Main" Then
      If HotSpotTag(0) = 12 Then Action.LoadAPicture Hotspot(11), "aq help manual hs.jpg"
   End If
If Action.GetCurrentFrameName = "1. Main" Then
      If HotSpotTag(0) = 14 Then Action.LoadAPicture Hotspot(13), "aq help progress hs.jpg"
   End If
If Action.GetCurrentFrameName = "1. Main" Then
      If HotSpotTag(0) = 16 Then Action.LoadAPicture Hotspot(15), "aq help credits hs.jpg"
   End If
If Action.GetCurrentFrameName = "1. Main" Then
      If HotSpotTag(0) = 18 Then Action.LoadAPicture Hotspot(17), "aq help return.jpg"
   End If

Sub KeyGuard_MouseLeavesHotSpot(HotspotTAG)
   'MsgBox "Mouse leaves hotspot area: " & HotspotTAG(0

If Action.GetCurrentFrameName = "1. Main" Then
   Action.LoadAPicture Hotspot(2), ""
   End If
If Action.GetCurrentFrameName = "1. Main" Then
   Action.LoadAPicture Hotspot(11), ""
   End If
If Action.GetCurrentFrameName = "1. Main" Then
   Action.LoadAPicture Hotspot(13), ""
   End If
If Action.GetCurrentFrameName = "1. Main" Then
   Action.LoadAPicture Hotspot(15), ""
   End If
If Action.GetCurrentFrameName = "1. Main" Then
   Action.LoadAPicture Hotspot(17), ""
   End If


Any thoughts?
User avatar
jack8135
Member
 
Posts: 26
Joined: Sat Feb 05, 2011 8:12 am

Postby ShadowHunter » Tue Jun 19, 2012 9:02 am

Hi,

When moving fast in and out it is possible that the OUT event is not detected by KeyGuard so it won't accept another IN movement.

I'm not sure which version of KG you are using but I would recommand KG5 which supports all better including Z-order.

Let me know how it goes...

With best regards,

ShAdOwHuNtEr
User avatar
ShadowHunter
Forum Admin and Games Page admin
 
Posts: 1304
Joined: Fri Jun 06, 2003 10:37 pm
Location: Belgium

Postby jack8135 » Tue Jun 19, 2012 10:09 am

Hi ShAdOwHuNtEr, thanks for the response!

I should have KG5 but now I'm confused...
I say I should have it because I downloaded Keyguard Professional Studio which ugraded it if I'm not mistaken. However, when I checked the version it says Keyguard 4.5.2

Just to make sure, I ran the KPS installer again and it did have the correct directory for the AM plugins folder but is still says version 4.5.2

The out event not having enough time to finish is a possibility but even at a casual pace the images will sometimes fail to load...

Are there any other methods to achieve the "button glow" effect I'm after?
Thanks for the help and thanks for KPS! :D
User avatar
jack8135
Member
 
Posts: 26
Joined: Sat Feb 05, 2011 8:12 am

Postby jack8135 » Tue Jun 19, 2012 7:15 pm

Incidentally I have a new problem,

when I reinstalled Keyguard Professional Studio it somehow reverted to the demo version and it will not let me register. The register option is greyed out. So now I keep getting the "5 hovers only until you register" pop up message and I have no idea how to get rid of it....

Is there a way to unregister so I can register again???
User avatar
jack8135
Member
 
Posts: 26
Joined: Sat Feb 05, 2011 8:12 am

Postby jack8135 » Tue Jun 19, 2012 7:39 pm

Sorry for the multiple posts, I'm not trying to bump but I just wanted to update that I did find a MUCH more efficient way to accomplish mouse hover.

Mercedes had posted this tutorial and project:
http://www.adventuremaker.com/phpBB2/viewtopic.php?t=6079

which is a much cleaner and more efficient method of achieving buttons that light up. Thanks Mercedes! :D :D :D
User avatar
jack8135
Member
 
Posts: 26
Joined: Sat Feb 05, 2011 8:12 am

Postby mercedes » Tue Jun 19, 2012 8:33 pm

You're welcome! I'm glad it helped..:D

It sounds cool when you add sound going in and out of the hotspot too..Something I forgot to do..:P
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron