EdwardNight
EdwardNight

Reputation: 3

Draw a circular dashed lines in Moai sdk

I don't know how to draw a circular dashed lines in moai using MoaiDraw? Could anyone tell me how to do that? sorry I'm a newbie in moai.

Upvotes: -2

Views: 68

Answers (2)

EdwardNight
EdwardNight

Reputation: 3

FreedomPride : it's just a red circle .

Upvotes: 0

FreedomPride
FreedomPride

Reputation: 1102

Could you try out with your version of MOAI

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 )



function onDraw ( index, xOff, yOff, xFlip, yFlip )

        MOAIDraw.fillCircle ( 0, 0, 64, 32 )

end



scriptDeck = MOAIScriptDeck.new ()

scriptDeck:setRect ( -64, -64, 64, 64 )

scriptDeck:setDrawCallback ( onDraw )



color = MOAIColor.new()

color:setColor(1, 0, 0, 1)



prop = MOAIProp2D.new ()

prop:setDeck ( scriptDeck )

layer:insertProp ( prop )



prop:setAttrLink(MOAIColor.INHERIT_COLOR, color, MOAIColor.COLOR_TRAIT)

Upvotes: 0

Related Questions