Module: LiteRGSS::Text::Util Deprecated
- Defined in:
- scripts/00700 Ajout_PSDK/00300 Text__Util.rb
Overview
Deprecated.
DO NOT FUCKING USE THIS. Use SpriteStack instead.
Utility module to manage text easly in user interfaces.
Constant Summary collapse
- DEFAULT_OUTLINE_SIZE =
Default outlinesize, nil gives a 0 and keep shadow processing, 0 or more disable shadow processing
nil
- FOY =
Offset induced by the Font
2
Instance Method Summary collapse
-
#add_text(x, y, width, height, str, align = 0, outlinesize = DEFAULT_OUTLINE_SIZE, type: Text) ⇒ Text
Add a text inside the window, the offset x/y will be adjusted.
-
#init_text(font_id = 0, viewport = nil, z = 1000)
Initialize the texts.
-
#text_dispose
Dispose the texts.
-
#text_each
Yield a block on each undisposed text.
-
#text_viewport ⇒ Viewport
Returns the text viewport.
-
#text_viewport=(v)
Change the text viewport.
Instance Method Details
#add_text(x, y, width, height, str, align = 0, outlinesize = DEFAULT_OUTLINE_SIZE, type: Text) ⇒ Text
Add a text inside the window, the offset x/y will be adjusted
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'scripts/00700 Ajout_PSDK/00300 Text__Util.rb', line 39 def add_text(x, y, width, height, str, align = 0, outlinesize = DEFAULT_OUTLINE_SIZE, type: Text) log_error('add_text from Text::Util is deprecated') if @window and @window. == @text_viewport x += (@ox + @window.x) y += (@oy + @window.y) end # voir pout y - FOY text = type.new(@font_id, @text_viewport, x, y - FOY, width, height, str.to_s, align, outlinesize) text.z = @window ? @window.z + 1 : @text_z text.draw_shadow = outlinesize.nil? @texts << text return text end |
#init_text(font_id = 0, viewport = nil, z = 1000)
Initialize the texts
22 23 24 25 26 27 28 |
# File 'scripts/00700 Ajout_PSDK/00300 Text__Util.rb', line 22 def init_text(font_id = 0, = nil, z = 1000) log_error('init_text is deprecated') @texts = [] unless @texts.class == Array @text_viewport = @font_id = font_id @text_z = z end |
#text_dispose
Dispose the texts
53 54 55 56 57 |
# File 'scripts/00700 Ajout_PSDK/00300 Text__Util.rb', line 53 def text_dispose log_error('text_dispose is deprecated') @texts.each { |text| text.dispose unless text.disposed? } @texts.clear end |
#text_each
Yield a block on each undisposed text
59 60 61 62 63 |
# File 'scripts/00700 Ajout_PSDK/00300 Text__Util.rb', line 59 def text_each log_error('text_each is deprecated') return unless block_given? @texts.each { |text| yield(text) unless text.disposed? } end |
#text_viewport ⇒ Viewport
Returns the text viewport
12 13 14 |
# File 'scripts/00700 Ajout_PSDK/00300 Text__Util.rb', line 12 def return @text_viewport end |
#text_viewport=(v)
Change the text viewport
16 17 18 |
# File 'scripts/00700 Ajout_PSDK/00300 Text__Util.rb', line 16 def (v) @text_viewport = v if v.is_a?(Viewport) end |