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
Junior Member

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

I am brand new to lua and new to fltk/fluid, so expect dumb questions from me. I find this stuff highly interesting and full of promises ;-). So, I decided to try and learn it to see what is possible. I would be interested in using murgaLua mostly to write mini educational games.

I can draw an interface, play it, modify and get some basic stuff done. However, I can't find the way to move an object on the screen dynamically, from within the lua script.

That's the onscreen object I want to move:

moving_point = fltk:Fl_Button(135, 35, 15, 15);

That's the dial I use to try and manipulate the x position of the object:

point_dial_x = fltk:Fl_Dial(26, 30, 25, 25);
point_dial_x:range(40, 200)

    -- fltk.fl_message(point_dial_x:x())  --> works, gives me the x value
    -- fltk.fl_message(point_dial_x:value()) --> works, gives me the value on the dial
    moving_point:set_x(point_dial_x:value());  --> causes a crash.

I tried: moving_point:x(int), moving_point:set_x(int), moving_point:move_x(int), none works. I can find mention of a o->position(x,y) construct on the fltk pages but don't know how to transfer this to murgaLua.

05-26-2007 03:45 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
Using callbacks to move objects on the screen - widged - 05-26-2007 03:45 AM

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

Forum Jump: