Class: Metro::Model::TextProperty
- Defined in:
- lib/metro/models/properties/text_property.rb
Overview
A text property maintains a string of text
Text is stored as text in properties. When retrieving the text, the contents of the text will be evaluated within the instance of the model’s scene. Which means that text may contain escaped variables referencing anything in the scene or the game.
Constant Summary
Constants included from Units
Instance Attribute Summary
Attributes inherited from Property
Instance Method Summary collapse
Methods inherited from Property
define_property, defined_properties, get, #get, get_or_set, gets, hash_with_default_to_nil, inherited, #initialize, properties, properties_hash, property, #set, set, sets
Constructor Details
This class inherits a constructor from Metro::Model::Property
Instance Method Details
#default_text ⇒ Object
68 69 70 |
# File 'lib/metro/models/properties/text_property.rb', line 68 def default_text [:default] || 'TEXT NOT SPECIFIED!' end |
#evalute_within_scene(text) ⇒ Object
64 65 66 |
# File 'lib/metro/models/properties/text_property.rb', line 64 def evalute_within_scene(text) model.scene.instance_eval( "\"#{text}\"" ) end |