Created
June 28, 2012 19:31
-
-
Save david-torres/3013369 to your computer and use it in GitHub Desktop.
Hello World using Moai SDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOAISim.openWindow('test', 320, 480) | |
viewport = MOAIViewport.new() | |
viewport:setSize(320, 480) | |
viewport:setScale(320, 480) | |
layer = MOAILayer2D.new() | |
layer:setViewport(viewport) | |
MOAISim.pushRenderPass(layer) | |
font = MOAIFont.new() | |
font:loadFromTTF('Bastarda-K.ttf', ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.?!', 12, 163) | |
textbox = MOAITextBox.new() | |
textbox:setFont(font) | |
textbox:setRect(-160, -80, 160, 80) | |
textbox:setLoc(0, -100) | |
textbox:setYFlip(true) | |
textbox:setAlignment(MOAITextBox.CENTER_JUSTIFY) | |
layer:insertProp(textbox) | |
text = '<c:0F0>Hello World!</>' | |
textbox:setString(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment