20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/author_engine/game/opal/touch_joystick.rb', line 20
def draw
combo = @radius + @joystick_radius
`#{@game.authorengine_canvas_context}.clearRect(#{@x - combo}, #{@y - combo}, #{combo + combo}, #{combo + combo})`
`#{@game.authorengine_canvas_context}.fillStyle = #{@background}`
`#{@game.authorengine_canvas_context}.beginPath()`
`#{@game.authorengine_canvas_context}.arc(#{@x}, #{@y}, #{@radius}, 0, 2 * Math.PI)`
`#{@game.authorengine_canvas_context}.fill()`
`#{@game.authorengine_canvas_context}.beginPath()`
`#{@game.authorengine_canvas_context}.fillStyle = #{@color}`
`#{@game.authorengine_canvas_context}.arc(#{@joystick_x}, #{@joystick_y}, #{@joystick_radius}, 0, 2 * Math.PI)`
`#{@game.authorengine_canvas_context}.fill()`
return nil
end
|