Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   GUI Problem (https://forums.graalonline.com/forums/showthread.php?t=81482)

Codein 08-26-2008 04:32 PM

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.

xXziroXx 08-26-2008 04:39 PM

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



Codein 08-26-2008 05:07 PM

Thanks :)

[email protected] 08-26-2008 06:38 PM

why not use a hint?

cbk1994 08-27-2008 12:15 AM

Quote:

Originally Posted by [email protected] (Post 1417982)
why not use a hint?

Doesn't offer the same customizability (I think?)

Codein 08-27-2008 03:24 PM

Quote:

Originally Posted by cbk1994 (Post 1418139)
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.


All times are GMT +2. The time now is 10:17 AM.

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