Class: Ray::Polygon::Point
- Inherits:
-
Object
- Object
- Ray::Polygon::Point
- Defined in:
- lib/ray/polygon.rb
Overview
One of the points contained in a polygon.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#polygon ⇒ Object
readonly
Returns the value of attribute polygon.
Instance Method Summary collapse
-
#color ⇒ Color
Color of the point.
-
#color=(color) ⇒ Object
Sets the color of the point.
-
#initialize(polygon, id) ⇒ Point
constructor
A new instance of Point.
- #inspect ⇒ Object
-
#outline ⇒ Color
Outline color of the point.
-
#outline=(outline) ⇒ Object
Sets the outline color of the point.
-
#pos ⇒ Ray::Vector2
Position of the point.
-
#pos=(pos) ⇒ Object
Sets the position of the point.
Constructor Details
#initialize(polygon, id) ⇒ Point
Returns a new instance of Point.
7 8 9 |
# File 'lib/ray/polygon.rb', line 7 def initialize(polygon, id) @polygon, @id = polygon, id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
46 47 48 |
# File 'lib/ray/polygon.rb', line 46 def id @id end |
#polygon ⇒ Object (readonly)
Returns the value of attribute polygon.
46 47 48 |
# File 'lib/ray/polygon.rb', line 46 def polygon @polygon end |
Instance Method Details
#color ⇒ Color
Returns Color of the point.
17 18 19 |
# File 'lib/ray/polygon.rb', line 17 def color @polygon.color_of(@id) end |
#color=(color) ⇒ Object
Sets the color of the point
32 33 34 |
# File 'lib/ray/polygon.rb', line 32 def color=(color) @polygon.set_color_of(@id, color) end |
#inspect ⇒ Object
41 42 43 44 |
# File 'lib/ray/polygon.rb', line 41 def inspect "#<#{self.class} polygon=#{polygon} id=#{id} pos=#{pos} color=#{color} \ outline=#{outline}>" end |
#outline ⇒ Color
Returns Outline color of the point.
22 23 24 |
# File 'lib/ray/polygon.rb', line 22 def outline @polygon.outline_of(@id) end |
#outline=(outline) ⇒ Object
Sets the outline color of the point
37 38 39 |
# File 'lib/ray/polygon.rb', line 37 def outline=(outline) @polygon.set_outline_of(@id, outline) end |
#pos ⇒ Ray::Vector2
Returns Position of the point.
12 13 14 |
# File 'lib/ray/polygon.rb', line 12 def pos @polygon.pos_of(@id) end |
#pos=(pos) ⇒ Object
Sets the position of the point
27 28 29 |
# File 'lib/ray/polygon.rb', line 27 def pos=(pos) @polygon.set_pos_of(@id, pos) end |