Class: UI::NameInputUI

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

Overview

Name Input UI window

Constant Summary collapse

NO_CHAR =

Character used to indicate there’s no char there

'_'

Instance Attribute Summary collapse

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

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

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, max_size, chars, character, phrase) ⇒ NameInputUI

Create a new NameInputUI

Parameters:

  • viewport (Viewport)
  • max_size (Integer)

    maximum size of the name

  • chars (Array<String>)

    chars initialize there

  • character (PFM::Pokemon, String, nil)

    the character to display

  • phrase (String)

    the phrase to display in order to justify the name input



29
30
# File 'docs/4_Systems_205_Input.rb', line 29

def initialize(viewport, max_size, chars, character, phrase)
end

Instance Attribute Details

#charsArray<String> (readonly)

Return the chars the user has inserted

Returns:



20
21
22
# File 'docs/4_Systems_205_Input.rb', line 20

def chars
  @chars
end

Instance Method Details

#add_char(char)

Add a character to the input

Parameters:



33
34
# File 'docs/4_Systems_205_Input.rb', line 33

def add_char(char)
end

#remove_char

Remove a character from the input



36
37
# File 'docs/4_Systems_205_Input.rb', line 36

def remove_char
end

#update

Update the window (caret)



39
40
# File 'docs/4_Systems_205_Input.rb', line 39

def update
end