Method: Graphics::Drawing#draw_on
- Defined in:
- lib/graphics/simulation.rb
#draw_on(texture) ⇒ Object
Temporarily render to a texture instead of the renderer’s window, then copy that texture to the renderer and present it.
749 750 751 752 753 754 755 756 757 |
# File 'lib/graphics/simulation.rb', line 749 def draw_on texture renderer.target = texture yield if block_given? ensure renderer.target = nil renderer.copy_texture texture renderer.present end |