Game Development Reference
In-Depth Information
The Moai equivalent of groups, using traits
In Moai, this is called setting a trait source , where traits are the attributes, such as the location,
transform, color, visibility, and so on. The setParent function is actually an alias to the
setTraitSource .
MOAISim.openWindow( "Group Test", 320, 480)
viewport = MAOIViewport.new()
viewport:setSize(320,480)
viewport:setScale(320,-480)
viewport:setOffset(-1,1)
layer = MOAILayer2D.new()
layer:setViewport(viewport)
MOAISim.pushRenderPass(layer)
function newImage(imageName, xPos, yPos)
local xPos = xPos or 0
local yPos = yPos or 0
local wd, ht
local img = MOAIImage.new()
img:load(imageName)
wd, ht = img:getSize()
 
Search WWH ::




Custom Search