Class: UI::Window

Inherits:
Window show all
Defined in:
docs/4_Systems_000_General_4_UI_Generics.rb

Overview

Window utility allowing to make Window easilly

Direct Known Subclasses

LevelUpWindow

Constant Summary collapse

DEFAULT_SKIN =

Default window skin

'message'

Instance Attribute Summary

Attributes inherited from LiteRGSS::Window

#__index__, #active, #back_opacity, #contents_opacity, #cursor_rect, #cursorskin, #height, #opacity, #ox, #oy, #pause, #pause_x, #pause_y, #pauseskin, #stretch, #viewport, #visible, #width, #window_builder, #windowskin, #x, #y, #z

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Window

#simple_mouse_in?, #translate_mouse_coords

Methods inherited from LiteRGSS::Window

#lock, #locked?, new, #set_origin, #set_position, #set_size, #unlock, #update

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, x = 2, y = 2, width = 316, height = 48, skin: DEFAULT_SKIN) ⇒ Window

Create a new Window

Parameters:

  • viewport (Viewport)

    viewport where the window is shown

  • x (Integer) (defaults to: 2)

    X position of the window

  • y (Integer) (defaults to: 2)

    Y position of the window

  • width (Integer) (defaults to: 316)

    Width of the window

  • height (Integer) (defaults to: 48)

    Height of the window

  • skin (String) (defaults to: DEFAULT_SKIN)

    Windowskin used to display the window



295
296
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 295

def initialize(viewport, x = 2, y = 2, width = 316, height = 48, skin: DEFAULT_SKIN)
end

Class Method Details

.from_metrics(viewport, x, y, width, height, skin: DEFAULT_SKIN, position: 'top_left')

Create a new window from given metrics

Parameters:

  • viewport (Viewport)

    viewport where the window is shown

  • x (Integer)

    x position of the window frame

  • y (Integer)

    y position of the window frame

  • width (Integer)

    width of the window contents

  • height (Integer)

    height of the window contents

  • skin (String) (defaults to: DEFAULT_SKIN)

    windowskin used to draw the window frame:

  • position (String) (defaults to: 'top_left')

    precision of the x/y positioning of the frame

    • ‘top_left’ : y is top side of the frame, x is left side of the frame

    • ‘top_right’ : y is top side of the frame, x is right side of the frame

    • ‘bottom_left’ : y is bottom side of the frame, x is left side of the frame

    • ‘bottom_right’ : y is bottom side of the frame, x is right side of the frame

    • ‘middle_center’ : y is middle height of the frame, x is center of the frame



315
316
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 315

def from_metrics(viewport, x, y, width, height, skin: DEFAULT_SKIN, position: 'top_left')
end

.window_builder(skin) ⇒ Array<Integer>

Get the Window Builder according to the skin

Parameters:

  • skin (String)

    windowskin used to show the window

Returns:

  • (Array<Integer>)

    the window builder



320
321
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 320

def window_builder(skin)
end

Instance Method Details

#add_line(line_index, str, align = 0, outlinesize = Text::Util::DEFAULT_OUTLINE_SIZE, type: Text, color: nil, dx: 0)

Add a text line to the window



329
330
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 329

def add_line(line_index, str, align = 0, outlinesize = Text::Util::DEFAULT_OUTLINE_SIZE, type: Text, color: nil, dx: 0)
end

#add_text(x, y, width, height, str, align = 0, outlinesize = Text::Util::DEFAULT_OUTLINE_SIZE, type: Text, color: 0)

Add a text to the window



325
326
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 325

def add_text(x, y, width, height, str, align = 0, outlinesize = Text::Util::DEFAULT_OUTLINE_SIZE, type: Text, color: 0)
end

#load_cursor

Load the cursor



344
345
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 344

def load_cursor
end

#push(x, y, bmp, *args, rect: nil, type: Sprite, ox: 0, oy: 0)

Push a sprite to the window



333
334
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 333

def push(x, y, bmp, *args, rect: nil, type: Sprite, ox: 0, oy: 0)
end

#sprite_stackSpriteStack

Return the sprite stack used by the window

Returns:



341
342
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 341

def sprite_stack
end

#stackArray

Return the stack of the window if any

Returns:

  • (Array)


337
338
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 337

def stack
end