Class: QuadrilateralPresenter
- Inherits:
-
Straightedge::Gosu::Presenter
- Object
- Straightedge::Presenter
- Straightedge::Gosu::Presenter
- QuadrilateralPresenter
- Defined in:
- lib/straightedge/gosu/presenters/quadrilateral_presenter.rb
Instance Method Summary collapse
Methods inherited from Straightedge::Gosu::Presenter
Instance Method Details
#display(rect) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/straightedge/gosu/presenters/quadrilateral_presenter.rb', line 2 def display(rect) real_coords = rect.corners.map { |xy| [xy.x + rect.x, xy.y + rect.y ] } colored_coords = colorize(real_coords, Straightedge::Colors.hex_value(rect.color)) #puts "--- rendering #{rect.color} at #{rect.x}, #{rect.y}" @surface.draw_quad(*colored_coords) end |