Class: Ruby2D::Quad
- Inherits:
-
Object
- Object
- Ruby2D::Quad
- Defined in:
- lib/ruby2d/quad.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#c1 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#c2 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#c3 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#c4 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#color ⇒ Object
Returns the value of attribute color.
-
#x1 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#x2 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#x3 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#x4 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#y1 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#y2 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#y3 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
-
#y4 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left.
Instance Method Summary collapse
-
#initialize(x1 = 0, y1 = 0, x2 = 100, y2 = 0, x3 = 100, y3 = 100, x4 = 100, y4 = 100, c = 'white') ⇒ Quad
constructor
A new instance of Quad.
- #remove ⇒ Object
Constructor Details
#initialize(x1 = 0, y1 = 0, x2 = 100, y2 = 0, x3 = 100, y3 = 100, x4 = 100, y4 = 100, c = 'white') ⇒ Quad
Returns a new instance of Quad.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ruby2d/quad.rb', line 17 def initialize(x1=0, y1=0, x2=100, y2=0, x3=100, y3=100, x4=100, y4=100, c='white') @type_id = 2 @x1, @y1, @x2, @y2, @x3, @y3, @x4, @y4 = x1, y1, x2, y2, x3, y3, x4, y4 @color = c update_color(c) if defined? Ruby2D::DSL Ruby2D::Application.add(self) end end |
Instance Attribute Details
#c1 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def c1 @c1 end |
#c2 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def c2 @c2 end |
#c3 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def c3 @c3 end |
#c4 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def c4 @c4 end |
#color ⇒ Object
Returns the value of attribute color.
15 16 17 |
# File 'lib/ruby2d/quad.rb', line 15 def color @color end |
#x1 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def x1 @x1 end |
#x2 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def x2 @x2 end |
#x3 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def x3 @x3 end |
#x4 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def x4 @x4 end |
#y1 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def y1 @y1 end |
#y2 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def y2 @y2 end |
#y3 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def y3 @y3 end |
#y4 ⇒ Object
Coordinates in clockwise order, starting at top left: x1,y1 == top left x2,y2 == top right x3,y3 == bottom right x4,y4 == bottom left
10 11 12 |
# File 'lib/ruby2d/quad.rb', line 10 def y4 @y4 end |
Instance Method Details
#remove ⇒ Object
33 34 35 36 37 |
# File 'lib/ruby2d/quad.rb', line 33 def remove if defined? Ruby2D::DSL Ruby2D::Application.remove(self) end end |