Module: ParticleFX2D::Renderer

Included in:
ParticleFX2D::Ruby2D::CanvasRendererFactory, ParticleFX2D::Ruby2D::ShapeRenderer
Defined in:
lib/particlefx2d/renderer.rb

Overview

Defines a particle renderer. Depending on the graphics system used to render the particle effects, you can implement either one single renderer per emitter that does the drawing implement a renderer per particle.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for(_particle) ⇒ Object

Factory method to provide a renderer for a particle. Called once per particle. The particle system does not care if the factory returns a shared renderer for all the particles or if it returns one per particle. Each particle will be associated with the renderer.



12
13
14
# File 'lib/particlefx2d/renderer.rb', line 12

def self.for(_particle)
  raise StandardError('unimplemented')
end

Instance Method Details

#draw_particle(_particle) ⇒ Object

Requests the render to draw the particle (or update the particle’s rendering peer with the particle’s visual attributes.)



30
31
32
# File 'lib/particlefx2d/renderer.rb', line 30

def draw_particle(_particle)
  raise StandardError('unimplemented')
end

#hide_particle(_particle) ⇒ Object

Notifies the renderer that a particle is hidden.



24
25
26
# File 'lib/particlefx2d/renderer.rb', line 24

def hide_particle(_particle)
  raise StandardError('unimplemented')
end

#show_particle(_particle) ⇒ Object

Notifies the renderer that a particle is visible.



19
20
21
# File 'lib/particlefx2d/renderer.rb', line 19

def show_particle(_particle)
  raise StandardError('unimplemented')
end