Class: Yuki::ChoiceWindow
- Inherits:
-
Window
- Object
- LiteRGSS::Disposable
- LiteRGSS::Drawable
- LiteRGSS::Window
- Window
- Yuki::ChoiceWindow
- Defined in:
- docs/4_Systems_000_General_4_UI_Generics.rb
Overview
Display a choice Window
Defined Under Namespace
Classes: But
Constant Summary collapse
- CursorSkin =
Name of the cursor in Graphics/Windowskins/
'Cursor'- WINDOW_SKIN =
Name of the windowskin in Graphics/Windowskins/
'Message'- MaxChoice =
Number of choice shown until a relative display is generated
9- DeltaChoice =
Index that tells the system to scroll up or down everychoice (relative display)
(MaxChoice / 2.0).round
Instance Attribute Summary collapse
-
#colors ⇒ Array<Integer>
Array of choice colors.
-
#index ⇒ Integer
Current choix (0~choice_max-1).
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
-
.generate_for_message(window) ⇒ ChoiceWindow
Function that creates a new ChoiceWindow for the message system.
Instance Method Summary collapse
-
#add_choice_text(text, i) ⇒ Integer
Function that adds a choice text and manage various thing like getting the actual width of the text.
-
#build_window
Build the window : update the height of the window and draw the options.
-
#current_layout ⇒ Configs::Project::Texts::ChoiceConfig
Retrieve the current layout configuration.
-
#current_window_builder ⇒ Array
Retrieve the current window_builder.
-
#current_windowskin ⇒ String
Retrieve the current windowskin.
-
#default_color ⇒ Integer
(also: #get_default_color)
Return the default text color.
-
#default_horizontal_margin ⇒ Integer
Return the default horizontal margin.
-
#default_line_height ⇒ Integer
Return the default height of a text line.
-
#default_vertical_margin ⇒ Integer
Return the default vertical margin.
-
#define_cursor_rect
Define the cursor rect.
-
#disable_color ⇒ Integer
(also: #get_disable_color)
Return the disable text color.
-
#initialize(width, choices, viewport = nil) ⇒ ChoiceWindow
constructor
Create a new ChoiceWindow with the right parameters.
-
#refresh
Draw the options.
-
#translate_color(color) ⇒ Integer
Translate the color according to the layout configuration.
-
#update
Update the choice, if player hit up or down the choice index changes.
-
#update_cursor_down
Update the choice display when player hit DOWN.
-
#update_cursor_up
Update the choice display when player hit UP.
-
#update_mouse
Update the mouse action.
-
#validated? ⇒ Boolean
Tells the choice is done.
-
#window_builder=(builder)
Change the window builder and rebuild the window.
Methods inherited from Window
#simple_mouse_in?, #translate_mouse_coords
Methods inherited from LiteRGSS::Window
#lock, #locked?, #set_origin, #set_position, #set_size, #unlock
Methods inherited from LiteRGSS::Disposable
Constructor Details
#initialize(width, choices, viewport = nil) ⇒ ChoiceWindow
Create a new ChoiceWindow with the right parameters
1166 1167 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1166 def initialize(width, choices, = nil) end |
Instance Attribute Details
#colors ⇒ Array<Integer>
Array of choice colors
1150 1151 1152 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1150 def colors @colors end |
#index ⇒ Integer
Current choix (0~choice_max-1)
1153 1154 1155 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1153 def index @index end |
Class Method Details
.generate_for_message(window) ⇒ ChoiceWindow
Function that creates a new ChoiceWindow for the message system
1245 1246 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1245 def self.(window) end |
Instance Method Details
#add_choice_text(text, i) ⇒ Integer
Function that adds a choice text and manage various thing like getting the actual width of the text
1217 1218 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1217 def add_choice_text(text, i) end |
#build_window
Build the window : update the height of the window and draw the options
1208 1209 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1208 def build_window end |
#current_layout ⇒ Configs::Project::Texts::ChoiceConfig
Retrieve the current layout configuration
1170 1171 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1170 def current_layout end |
#current_window_builder ⇒ Array
Retrieve the current window_builder
1240 1241 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1240 def current_window_builder end |
#current_windowskin ⇒ String
Retrieve the current windowskin
1236 1237 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1236 def current_windowskin end |
#default_color ⇒ Integer Also known as: get_default_color
Return the default text color
1186 1187 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1186 def default_color end |
#default_horizontal_margin ⇒ Integer
Return the default horizontal margin
1228 1229 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1228 def default_horizontal_margin end |
#default_line_height ⇒ Integer
Return the default height of a text line
1182 1183 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1182 def default_line_height end |
#default_vertical_margin ⇒ Integer
Return the default vertical margin
1232 1233 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1232 def default_vertical_margin end |
#define_cursor_rect
Define the cursor rect
1220 1221 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1220 def define_cursor_rect end |
#disable_color ⇒ Integer Also known as: get_disable_color
Return the disable text color
1191 1192 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1191 def disable_color end |
#refresh
Draw the options
1211 1212 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1211 def refresh end |
#translate_color(color) ⇒ Integer
Translate the color according to the layout configuration
1178 1179 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1178 def translate_color(color) end |
#update
Update the choice, if player hit up or down the choice index changes
1173 1174 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1173 def update end |
#update_cursor_down
Update the choice display when player hit DOWN
1201 1202 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1201 def update_cursor_down end |
#update_cursor_up
Update the choice display when player hit UP
1198 1199 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1198 def update_cursor_up end |
#update_mouse
Update the mouse action
1195 1196 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1195 def update_mouse end |
#validated? ⇒ Boolean
Tells the choice is done
1224 1225 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1224 def validated? end |
#window_builder=(builder)
Change the window builder and rebuild the window
1205 1206 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 1205 def window_builder=(builder) end |