Sha256: a7e6a5ee7d18618623af2751d87c8bc630c4f0b29740a830d4f9509f37b554fd

Contents?: true

Size: 515 Bytes

Versions: 2

Compression:

Stored size: 515 Bytes

Contents

# -*- coding: utf-8 -*-

require 'forwardable'

module DXRubySDL
  class RenderTarget
    extend Forwardable

    attr_reader :_surface

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

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

    alias_method :drawFont, :draw_font
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dxruby_sdl-0.0.15 lib/dxruby_sdl/render_target.rb
dxruby_sdl-0.0.14 lib/dxruby_sdl/render_target.rb