Class: RGame::Engine::Component

Inherits:
Object
  • Object
show all
Extended by:
Signal::DSL
Defined in:
lib/rgame/engine/component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Signal::DSL

signal

Instance Attribute Details

#nodeObject

Returns the value of attribute node.



8
9
10
# File 'lib/rgame/engine/component.rb', line 8

def node
  @node
end

Instance Method Details

#contextObject



10
11
12
# File 'lib/rgame/engine/component.rb', line 10

def context
  @context ||= node.context
end

#control(actions) ⇒ Object



21
# File 'lib/rgame/engine/component.rb', line 21

def control(actions); end

#draw(renderer, view) ⇒ Object



23
# File 'lib/rgame/engine/component.rb', line 23

def draw(renderer, view); end

#on_attachObject

Tree-lifecycle hooks. on_attach fires once the node is in the live tree, so node.root / node.scene and sibling systems are reachable — pull and register shared systems here, not in initialize (where the node has no anchors yet). on_detach mirrors it: release those registrations.



18
# File 'lib/rgame/engine/component.rb', line 18

def on_attach; end

#on_detachObject



19
# File 'lib/rgame/engine/component.rb', line 19

def on_detach; end

#sweep_freedObject

Container components (e.g. SceneStack) that hold nodes off the normal child list override this to forward the deferred-free sweep into them.



27
# File 'lib/rgame/engine/component.rb', line 27

def sweep_freed; end

#update(dt) ⇒ Object



22
# File 'lib/rgame/engine/component.rb', line 22

def update(dt); end