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.
Asked
Active
Viewed 59 times
2 Answers
0
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)

FreedomPride
- 1,098
- 1
- 7
- 30
-
i 've try your code, but it draw a full red circle, not a circular dashed lines? – EdwardNight Sep 11 '17 at 02:44
-
@EdwardNight, do you have it in a pic? – FreedomPride Sep 11 '17 at 03:03
-
https://i.stack.imgur.com/xJent.png you can see it, it's just a red circle – EdwardNight Sep 11 '17 at 03:22
-
@EdwardNight, i mean what's your expected output you're looking for, could you show an example. – FreedomPride Sep 11 '17 at 03:23