Class: DXRubySDL::RenderTarget

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/dxruby_sdl/render_target.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height, color) ⇒ RenderTarget

Returns a new instance of RenderTarget.



11
12
13
14
# File 'lib/dxruby_sdl/render_target.rb', line 11

def initialize(width, height, color)
  @image = Image.new(width, height, color)
  @_surface = @image._surface
end

Instance Attribute Details

#_surfaceObject (readonly)

Returns the value of attribute _surface.



9
10
11
# File 'lib/dxruby_sdl/render_target.rb', line 9

def _surface
  @_surface
end

Instance Method Details

#draw_font(x, y, string, font, option = {}) ⇒ Object Also known as: drawFont



18
19
20
21
# File 'lib/dxruby_sdl/render_target.rb', line 18

def draw_font(x, y, string, font, option = {})
  color = option[:color] || [255, 255, 255]
  @image.draw_font(x, y, string, font, color) 
end