Class: Engine::Components::PointLight
- Inherits:
-
Engine::Component
- Object
- Engine::Component
- Engine::Components::PointLight
- Defined in:
- lib/engine/components/point_light.rb
Instance Attribute Summary collapse
-
#colour ⇒ Object
Returns the value of attribute colour.
-
#range ⇒ Object
Returns the value of attribute range.
Attributes inherited from Engine::Component
Class Method Summary collapse
Instance Method Summary collapse
- #destroy! ⇒ Object
-
#initialize(range: 300, colour: [1.0, 1.0, 1.0]) ⇒ PointLight
constructor
A new instance of PointLight.
- #start ⇒ Object
Methods inherited from Engine::Component
#_erase!, #destroy, #destroyed?, destroyed_components, erase_destroyed_components, method_added, #renderer?, #set_game_object, #ui_renderer?, #update
Constructor Details
#initialize(range: 300, colour: [1.0, 1.0, 1.0]) ⇒ PointLight
Returns a new instance of PointLight.
7 8 9 10 |
# File 'lib/engine/components/point_light.rb', line 7 def initialize(range: 300, colour: [1.0, 1.0, 1.0]) @range = range @colour = colour end |
Instance Attribute Details
#colour ⇒ Object
Returns the value of attribute colour.
5 6 7 |
# File 'lib/engine/components/point_light.rb', line 5 def colour @colour end |
#range ⇒ Object
Returns the value of attribute range.
5 6 7 |
# File 'lib/engine/components/point_light.rb', line 5 def range @range end |
Class Method Details
.point_lights ⇒ Object
20 21 22 |
# File 'lib/engine/components/point_light.rb', line 20 def self.point_lights @point_lights ||= [] end |
Instance Method Details
#destroy! ⇒ Object
16 17 18 |
# File 'lib/engine/components/point_light.rb', line 16 def destroy! PointLight.point_lights.delete(self) end |
#start ⇒ Object
12 13 14 |
# File 'lib/engine/components/point_light.rb', line 12 def start PointLight.point_lights << self end |