Class: Languages::Epl2::Text
- Inherits:
-
Object
- Object
- Languages::Epl2::Text
- Defined in:
- lib/languages/epl2/text.rb
Instance Attribute Summary collapse
-
#font ⇒ Object
Returns the value of attribute font.
-
#position ⇒ Object
Returns the value of attribute position.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Text
constructor
A new instance of Text.
- #render ⇒ Object
- #x=(x) ⇒ Object
- #y=(y) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Text
Returns a new instance of Text.
6 7 8 9 10 11 12 |
# File 'lib/languages/epl2/text.rb', line 6 def initialize(opts = {}) # FIXME @position = Languages::Epl2::Position[0,0] @font = opts[:font] || Epl2::Font.new @position = Languages::Epl2::Position.from_array(opts[:at]) if opts.has_key?(:at) @text = "" end |
Instance Attribute Details
#font ⇒ Object
Returns the value of attribute font.
4 5 6 |
# File 'lib/languages/epl2/text.rb', line 4 def font @font end |
#position ⇒ Object
Returns the value of attribute position.
4 5 6 |
# File 'lib/languages/epl2/text.rb', line 4 def position @position end |
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/languages/epl2/text.rb', line 4 def text @text end |
Instance Method Details
#render ⇒ Object
14 15 16 |
# File 'lib/languages/epl2/text.rb', line 14 def render "A#{@position},#{@font.rotation},#{@font.name},#{@font.height},#{@font.width},N,\"#{@text}\"" end |
#x=(x) ⇒ Object
18 19 20 |
# File 'lib/languages/epl2/text.rb', line 18 def x=(x) @position.x = x end |
#y=(y) ⇒ Object
22 23 24 |
# File 'lib/languages/epl2/text.rb', line 22 def y=(y) @position.y = y end |