Class: PFM::Message::WidthComputer
- Defined in:
- scripts/01450 Systems/00004 Message/00001 Logic/00004 WitdhComputer.rb
Overview
Class that helps to compute the width of the words
Instance Method Summary collapse
-
#big_width(text) ⇒ Integer
Get the width of the text when it's big.
-
#disposed? ⇒ Boolean
Tell if any of the text is disposed.
-
#initialize(text_normal, text_big) ⇒ WidthComputer
constructor
Create a new WidthComputer.
-
#normal_width(text) ⇒ Integer
Get the normal width of the text.
Constructor Details
#initialize(text_normal, text_big) ⇒ WidthComputer
Create a new WidthComputer
10 11 12 13 |
# File 'scripts/01450 Systems/00004 Message/00001 Logic/00004 WitdhComputer.rb', line 10 def initialize(text_normal, text_big) @text_normal = text_normal @text_big = text_big end |
Instance Method Details
#big_width(text) ⇒ Integer
Get the width of the text when it's big
25 26 27 |
# File 'scripts/01450 Systems/00004 Message/00001 Logic/00004 WitdhComputer.rb', line 25 def big_width(text) @text_big.text_width(text) end |
#disposed? ⇒ Boolean
Tell if any of the text is disposed
31 32 33 |
# File 'scripts/01450 Systems/00004 Message/00001 Logic/00004 WitdhComputer.rb', line 31 def disposed? return @text_big.disposed? || @text_normal.disposed? end |
#normal_width(text) ⇒ Integer
Get the normal width of the text
18 19 20 |
# File 'scripts/01450 Systems/00004 Message/00001 Logic/00004 WitdhComputer.rb', line 18 def normal_width(text) @text_normal.text_width(text) end |