Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-26-2008, 04:32 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
GUI Problem

PHP Code:
function onTimeout() {
  for (
0<= this.itemidi++) {
    
temp.itemx InventoryControl.+ ("InventoryItem_" i).x;
    
temp.itemy InventoryControl.+ ("InventoryItem_" i).y;
    
    if (
mousescreenx in |temp.itemxtemp.itemx 32| && mousescreeny in |temp.itemytemp.itemy 32|) {
      new 
GuiTextCtrl("ItemText") {
          
        
profile GuiBlueTextProfile;
            
            
/*useownprofile = true;
            profile.fontcolor = {255, 255, 255};
            profile.fillcolor = {0, 0, 0};
            profile.opaque = true;*/
            
        
mousescreenx;
        
mousescreeny;
        
height 10;
            
        
text "Item";            
      }
    }
    
    else {
      if (
ItemText != NULLItemText.destroy();
    }
    
  }
  
  
setTimer(0.05);

This is a strange problem. Instead of the mouse pointer being detected over the items, it's being detected in the top right of the GUI Control. However, when using echo()s and what not, it detects where the mouse is just fine.

Very strange indeed.
Reply With Quote
  #2  
Old 08-26-2008, 04:39 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Uhm... when you create the control, do something like:

PHP Code:
new myGuiControlType("foobar")
{
  
thiso.catchevent(this"onMouseEnter""onMouseEntered");
  
thiso.catchevent(this"onMouseLeave""onMouseLeft");
}

function 
onMouseEntered()
{
  
// Stuff
}

function 
onMouseLeft()
{
  
// Stuff

__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #3  
Old 08-26-2008, 05:07 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Thanks
Reply With Quote
  #4  
Old 08-26-2008, 06:38 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
why not use a hint?
Reply With Quote
  #5  
Old 08-27-2008, 12:15 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by [email protected] View Post
why not use a hint?
Doesn't offer the same customizability (I think?)
__________________
Reply With Quote
  #6  
Old 08-27-2008, 03:24 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by cbk1994 View Post
Doesn't offer the same customizability (I think?)
It doesn't.

Either way, I've made it different now, still using onMouseEnter and what not. Looks pretty sweet.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.