Thread: Winique
View Single Post
Old 7th June 2005, 05:11   #35
leechbite
Major Dude
 
leechbite's Avatar
 
Join Date: Sep 2003
Location: Canada
Posts: 635
Send a message via Yahoo to leechbite
i modified Anunaki's xui-button script to make it do what you described (it was very similar). the script was not tested nor compiled, so there could be some bugs/typos.

PHP Code:

Global group ButtonGroup;
Global 
guiobject realButton;
Global 
text buttonText;
Global 
boolean mouseOver;

Global 
string colordownColorhoverColor;

System.onScriptLoaded() {
  
ButtonGroup getScriptGroup();

  
realButton buttonGroup.getObject("real.button");
  
buttonText buttonGroup.getObject("button.text");

  
mouseOver 0;
}

System.onScriptUnloading() {
  
realButton NULL;  // clears all events
}

realButton.onLeftButtonDown(int xint y) {
  
buttonText.setXMLParam("color",downcolor);
}

realButton.onLeftButtonUp(int xint y) {
  if (
mouseOver)
    
buttonText.setXMLParam("color",hovercolor);
  else
    
buttonText.setXMLParam("color"color);
}

realButton.onEnterArea() {
  
mouseOver 1;
  
buttonText.setXMLParam("color",hovercolor);
}

realButton.onLeaveArea() {
  
mouseOver 0;
  
buttonText.setXMLParam("color"color);
}

System.onSetXuiParam(String paramString value) {
  
param system.strlower(param);
  if (
param=="text") {
    
buttonText.setText(value);
  } else if (
param=="color") {
    
color value;
    
buttonText.setXMLParam("color"color);
  } else if (
param=="hovercolor") {
    
hoverColor value;
  } else if (
param=="downcolor") {
    
downColor value;
  }

hope this helps.
leechbite is offline   Reply With Quote