Class: Pixiurge::Display::TextEffect
- Inherits:
-
Pixiurge::Displayable
- Object
- Pixiurge::Displayable
- Pixiurge::Display::TextEffect
- Defined in:
- lib/pixiurge/displayable/text_effect.rb
Overview
This is for a text "effect" - that is, text that exists for a short time and then disappears, a bit like a particle.
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
-
#initialize(text, style: { fill: "yellow", fontSize: "20pt", wordwrap: false, wordWrapWidth: 100 }, final_properties: { y: "-20", alpha: 0.1 }, duration: 5000, name:, engine_connector:) ⇒ TextEffect
constructor
Constructor - create the text effect object.
-
#messages_to_show_player(player) ⇒ Array
Messages to show this Displayable to a player.
Methods inherited from Pixiurge::Displayable
#destroy_for_player, #move_for_player, #show_to_player
Constructor Details
#initialize(text, style: { fill: "yellow", fontSize: "20pt", wordwrap: false, wordWrapWidth: 100 }, final_properties: { y: "-20", alpha: 0.1 }, duration: 5000, name:, engine_connector:) ⇒ TextEffect
Constructor - create the text effect object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/pixiurge/displayable/text_effect.rb', line 15 def initialize text, style: { fill: "yellow", fontSize: "20pt", wordwrap: false, wordWrapWidth: 100 }, final_properties: { y: "-20", alpha: 0.1 }, duration: 5000, name:, engine_connector: @text = text @style = style @final_properties = final_properties @duration = duration @displayable_type = "text_effect" super(name: name, engine_connector: engine_connector) end |
Instance Method Details
#messages_to_show_player(player) ⇒ Array
Messages to show this Displayable to a player.
33 34 35 36 37 |
# File 'lib/pixiurge/displayable/text_effect.rb', line 33 def (player) = super [0].merge!({ "text" => @text, "style" => @style, "duration" => 5000, "finalProperties" => @final_properties }) end |