News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Using callbacks to move objects on the screen
Author Message
widged
Junior Member
**


Posts: 35
Group: Registered
Joined: May 2007
Status: Offline
Reputation: 0
Post: #1
RE: Using callbacks to move objects on the screen

widged Wrote:
There shouldn't be the need for two square_cb functions...


Learning the basics of Lua.

Code:
square2:callback(square2_cb)


is in fact equivalent to

Code:
square2.callback(square2, square2_cb)


which means that no more than one square_cb function is needed:

Code:
function square_cb(self)
  square = self
  thing:show()
  w:redraw()
end

...

square2:callback(square_cb)

This post was last modified: 06-03-2007 04:27 AM by widged.

06-03-2007 03:33 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
RE: Using callbacks to move objects on the screen - widged - 06-03-2007 03:33 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: