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 
drawing graphics in murgaLua
Author Message
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #1
RE: drawing graphics in murgaLua

And now for an animated demo ... Looks a lot nicer on murgaLua 0.5 but you'll have to wait ;-)

Code:
function draw_callback(eventValue)

  -- Need to look into what event 11 is ...

  if (Fl:event() == 0 or Fl:event() == 11)
  then
      -- 0 means no even I think, so we know we are requesting a draw.
      fltk.fl_color(96+counter)

      w:make_current()

      fltk.fl_rectf(20+counter,20,50,50)
      fltk.fl_draw("this is a test",20,80+counter)
      fltk.fl_loop( 20,20,80+counter,80+counter, 200,0)
      counter=counter+4
      if counter > 120 then counter=2 end
  else
      print(Fl:event())
      os.exit(0)
  end

end

counter = 0

w=fltk:Fl_Window(0,0, 210, 220, "draw demo")

w:callback(draw_callback)

w:color(55)

w:show()

while 1 do
    Fl:check()
    w:do_callback()
    -- murgaLua.sleep(25) -- Milliseconds, looks really cool (murgaLua 0.5).

    -- This sleeps reliably for one second
    socket.sleep(1)
end

Fl:run()

06-23-2007 07:54 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
drawing graphics in murgaLua - widged - 06-05-2007, 11:01 PM
RE: drawing graphics in murgaLua - mikshaw - 06-06-2007, 02:00 AM
RE: drawing graphics in murgaLua - mikshaw - 06-23-2007, 06:00 AM
RE: drawing graphics in murgaLua - JohnMurga - 06-23-2007 07:54 AM
RE: drawing graphics in murgaLua - mikshaw - 06-23-2007, 12:38 PM
RE: drawing graphics in murgaLua - mikshaw - 06-23-2007, 01:02 PM
RE: drawing graphics in murgaLua - iGame3D - 06-25-2007, 03:29 PM
RE: drawing graphics in murgaLua - iGame3D - 06-25-2007, 08:11 PM
RE: drawing graphics in murgaLua - iGame3D - 06-25-2007, 08:25 PM
RE: drawing graphics in murgaLua - mikshaw - 06-27-2007, 12:21 AM

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

Forum Jump: