Class: DXRubySDL::RenderTarget
- Inherits:
-
Object
- Object
- DXRubySDL::RenderTarget
- Extended by:
- Forwardable
- Defined in:
- lib/dxruby_sdl/render_target.rb
Instance Attribute Summary collapse
-
#_surface ⇒ Object
readonly
Returns the value of attribute _surface.
Instance Method Summary collapse
- #draw_font(x, y, string, font, option = {}) ⇒ Object (also: #drawFont)
-
#initialize(width, height, color) ⇒ RenderTarget
constructor
A new instance of RenderTarget.
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
#_surface ⇒ Object (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 |