Sha256: d19d9be709380c2004a588f87902cad475c83e73db7e00b9348a3d71514cfbec

Contents?: true

Size: 1022 Bytes

Versions: 2

Compression:

Stored size: 1022 Bytes

Contents

require "gosu"
require "onsengame/z_order"

module Onsengame
  module Object
    module Base
      attr_reader :x, :y
      def initialize(window, x, y, options={})
        @window = window
        @x = x
        @y = y
        @color = options[:color] || Gosu::Color::WHITE
        @z_order = options[:z_order] || ZOrder::OBJECT
        @font_name = options[:font_name] || "PressStart2P"
        @font_path = File.join(@window.options[:font_dir],
                               "#{@font_name}.ttf")
        @font_size = options[:font_size] || 24
        @font = Gosu::Font.new(@window,
                               @font_path,
                               @font_size)
      end

      def update
      end

      def draw
      end

      def draw_rectangle(x1, y1, x2, y2, color, z_order)
        @window.draw_quad(x1, y1, color,
                          x2, y1, color,
                          x2, y2, color,
                          x1, y2, color,
                          z_order)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onsengame-0.0.2 lib/onsengame/object/base.rb
onsengame-0.0.1 lib/onsengame/object/base.rb