Class: Pixiurge::Display::Invisible
- Inherits:
-
Pixiurge::Displayable
- Object
- Pixiurge::Displayable
- Pixiurge::Display::Invisible
- Defined in:
- lib/pixiurge/displayable/invisible.rb
Overview
An Invisible Displayable is just a visual no-op - showing and hiding it do nothing. You could use a single empty spritestack to get the same effect. This permits "showing" items that shouldn't have any visible presence without doing something too tricky.
Instance Attribute Summary
Attributes inherited from Pixiurge::Displayable
#block_height, #block_width, #displayable_type, #location_displayable, #location_name, #name, #position, #x, #y
Instance Method Summary collapse
-
#destroy_for_player(player) ⇒ Object
Do nothing to hide an Invisible object.
-
#initialize(name:, engine_connector:) ⇒ Invisible
constructor
Constructor.
-
#messages_to_show_player(player) ⇒ Object
Do nothing to display an Invisible object, don't call super.
-
#move_for_player(player, old_pos, new_pos, options) ⇒ Object
Do nothing to move an Invisible object.
Methods inherited from Pixiurge::Displayable
Constructor Details
#initialize(name:, engine_connector:) ⇒ Invisible
Constructor
13 14 15 16 |
# File 'lib/pixiurge/displayable/invisible.rb', line 13 def initialize name:, engine_connector: super @displayable_type = "invisible" # This should never go over the network, though... end |
Instance Method Details
#destroy_for_player(player) ⇒ Object
Do nothing to hide an Invisible object
28 29 |
# File 'lib/pixiurge/displayable/invisible.rb', line 28 def destroy_for_player(player) end |
#messages_to_show_player(player) ⇒ Object
Do nothing to display an Invisible object, don't call super
21 22 23 |
# File 'lib/pixiurge/displayable/invisible.rb', line 21 def (player) [] end |
#move_for_player(player, old_pos, new_pos, options) ⇒ Object
Do nothing to move an Invisible object
34 35 |
# File 'lib/pixiurge/displayable/invisible.rb', line 34 def move_for_player(player, old_pos, new_pos, ) end |