class Salamander::Canvas
Attributes
surface[R]
Public Class Methods
new(surface)
click to toggle source
# File lib/salamander/canvas.rb, line 5 def initialize (surface) @surface = surface end
Public Instance Methods
arc(x, y, radius, left, right, color)
click to toggle source
# File lib/salamander/canvas.rb, line 21 def arc (x, y, radius, left, right, color) SDL::Gfx.arcColor(surface, x.round, y.round, radius.round, left.round, right.round, color) end
circle(x, y, radius, color)
click to toggle source
# File lib/salamander/canvas.rb, line 25 def circle (x, y, radius, color) SDL::Gfx.circleColor(surface, x.round, y.round, radius.round, color) end
height()
click to toggle source
# File lib/salamander/canvas.rb, line 34 def height surface.h end
line(x1, y1, x2, y2, color)
click to toggle source
# File lib/salamander/canvas.rb, line 17 def line (x1, y1, x2, y2, color) SDL::Gfx.lineColor(surface, x1.round, y1.round, x2.round, y2.round, color) end
point(x, y, color)
click to toggle source
# File lib/salamander/canvas.rb, line 13 def point (x, y, color) SDL::Gfx.pixelColor(surface, x.round, y.round, color) end
redraw()
click to toggle source
# File lib/salamander/canvas.rb, line 9 def redraw SDL.UpdateRect(surface, 0, 0, width, height) end
width()
click to toggle source
# File lib/salamander/canvas.rb, line 30 def width surface.w end