Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-02-2008, 03:53 PM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
addEventListener

Like in javascript, subscribe to events using code.

PHP Code:
  function onCreated() {
    
this.addEventListener("this.onWeaponfired", function() {
      
player.chat "Hi!";
    });
    
showGUI();
  }
  function 
showGUI() {
    new 
GuiBitmapBorderCtrl("this.radiogui") {
      
profile GuiBitmapBorderProfile;
      
canmove false;
      
canresize false;
      
height 50;
      
width 385;
      
screenwidth width 20;
      
= -50;
      
visible true;
      new 
GuiButtonCtrl("PlayButton") {
        
25;
        
5;
        
alpha 1;
        
width 50;
        
height 20;
        
text "Play";
      }
      new 
GuiButtonCtrl("MuteButton") {
        
25;
        
25;
        
alpha 1;
        
width 50;
        
height 20;
        
text "Mute";
      }
    }
    
this.addEventListener("MuteButton.onMouseDown", function(MouseEvent) {
      echo(@
MouseEvent.mousescreenx);
    });
  } 
etc. What say thee Stefan?
Reply With Quote
 


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 03:07 PM.


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