Aww, I love my Lua!

posted in owl's Blog
Published May 13, 2011
Advertisement
app = owl.get_app()

function btn_new_game_click()
print (app.clock:get_fps())
end

-- Create Button New Game
btn = owl.create_button(app.gui.root)
btn:text("New Game")
btn:move(200,200)
btn:resize(600, 40)
btn:on_click(app.script, "btn_new_game_click")
btn:center_horizontally(app.gui.root)

label = owl.create_label(app.gui.root)
label:text("FPS:")
label:foreground_color(255,255,255,255)
label:move(100,100)
label:resize(100,20)


lua01.jpg
0 likes 2 comments

Comments

yckx
Coolness. I really need to get more familiar with Lua. I've learned some, but I can't really use it that effectively.
May 15, 2011 03:07 PM
owl
It's really cool. If you dare, take a look at my previous entries on SWIG. That's how I use Lua in my project. I've almost interfaced my entire codebase.

I'm currently working on the level editor, which it's logic is completely done with Lua through SWIG.
May 15, 2011 04:27 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement