Sha256: c5a04de9ab9656b2182c0b60531e21bfa39f7bda3c97e159eb7ac890904525cf

Contents?: true

Size: 408 Bytes

Versions: 2

Compression:

Stored size: 408 Bytes

Contents

# square.rb

module Ruby2D
  class Square < Rectangle
    
    attr_reader :size
    
    def initialize(x=0, y=0, s=100, c='white')
      @type_id = 2
      @x, @y, @color = x, y, c
      @width = @height = @size = s
      update_coords(x, y, s, s)
      update_color(c)
      add
    end
    
    def size=(s)
      self.width = self.height = @size = s
    end
    
    private :width=, :height=
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby2d-0.3.1 lib/ruby2d/square.rb
ruby2d-0.3.0 lib/ruby2d/square.rb