forked from moai/moai-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
45 lines (31 loc) · 1.04 KB
/
Copy pathmain.lua
File metadata and controls
45 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
----------------------------------------------------------------
-- Copyright (c) 2010-2017 Zipline Games, Inc.
-- All Rights Reserved.
-- http://getmoai.com
----------------------------------------------------------------
MOAISim.openWindow ( "test", 320, 480 )
viewport = MOAIViewport.new ()
viewport:setSize ( 320, 480 )
viewport:setScale ( 320, 480 )
layer = MOAIPartitionViewLayer.new ()
layer:setViewport ( viewport )
layer:pushRenderPass ()
gfxQuad = MOAIGfxQuad2D.new ()
gfxQuad:setTexture ( "moai.png" )
gfxQuad:setRect ( -64, -64, 64, 64 )
prop = MOAIProp.new ()
prop:setDeck ( gfxQuad )
prop:setPartition ( layer )
function threadFunc ()
local action
action = prop:moveRot ( 180, 3 )
MOAIThread.blockOnAction ( action )
action = prop:moveLoc ( 64, 0, 2 )
MOAIThread.blockOnAction ( action )
action = prop:moveScl ( -0.5, -0.5, 1 )
MOAIThread.blockOnAction ( action )
action = prop:moveRot ( -180, 3 )
MOAIThread.blockOnAction ( action )
end
thread = MOAIThread.new ()
thread:run ( threadFunc )