diff options
Diffstat (limited to 'lib/ruby2d/rectangle.rb')
| -rw-r--r-- | lib/ruby2d/rectangle.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/ruby2d/rectangle.rb b/lib/ruby2d/rectangle.rb index 4b9db5e..43b0db5 100644 --- a/lib/ruby2d/rectangle.rb +++ b/lib/ruby2d/rectangle.rb @@ -1,4 +1,4 @@ -# rectangle.rb +# Ruby2D::Rectangle module Ruby2D class Rectangle < Quad @@ -6,15 +6,13 @@ module Ruby2D attr_reader :x, :y, :width, :height def initialize(opts = {}) - @x = opts[:x] || 0 - @y = opts[:y] || 0 - @z = opts[:z] || 0 - @width = opts[:width] || 200 + @x = opts[:x] || 0 + @y = opts[:y] || 0 + @z = opts[:z] || 0 + @width = opts[:width] || 200 @height = opts[:height] || 100 - - update_coords(@x, @y, @width, @height) - self.color = opts[:color] || 'white' + update_coords(@x, @y, @width, @height) add end |
