View Single Post
  #2  
Unread 04-17-2017, 11:52 AM
Thurallor's Avatar
Thurallor Thurallor is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: May 2013
Posts: 202
First, remove the "()" after Turbine.UI.Window in the first line. You're not deriving MyClass from an instance of Turbine.UI.Window, but from the class itself.

Second, if you've set "SetWantUpdates(true)", then you need to define an Update event handler, which will be called at each "tick".

Third, your MouseDown event handler won't get its arguments correctly:

Code:
function MyWindow:MouseDownHandler(s,a)
Since you used the ":" notation, the first argument will be silently consumed and assigned to the "self" local variable. You should remove the explicit "s" argument, so the arguments you want will go into "a".

Edit: In case it's not obvious, you also need to create an instance of MyWindow. Add "m = MyWindow();" at the end of your code.

Last edited by Thurallor : 04-17-2017 at 11:59 AM. Reason: added note about instantiation
Reply With Quote