Window Game API
Back
These functions can be called by any Lua script as long as the
program is currently in the Game Lua state.
You can think of these functions as actually being part of the Game API,
but we are listing them separately because they are related and the
Game API is quite large.
Window Managing
string ga_win_wid_to_win_name(int wid);
int ga_win_win_name_to_wid(string win_name);
LIST ga_win_get_windows_on_hud();
LIST ga_win_get_windows_on_stack();
string ga_win_get_stack_top();
bool ga_win_is_any_window_open();
bool ga_win_is_window_on_hud(string win_name);
bool ga_win_is_window_on_stack(string win_name);
bool ga_win_is_window_on_stack_top(string win_name);
LIST ga_win_get_windows_on_main_menu_stack(); //Deprecated.
LIST ga_win_get_windows_on_game_stack(); //Deprecated.
string ga_win_get_main_menu_stack_top(); //Deprecated.
string ga_win_get_game_stack_top(); //Deprecated.
Screen Coordinate Modes
string ga_win_get_screen_coord_mode(int wid);
void ga_win_set_screen_coord_mode(int wid, string mode);
Vector ga_win_inner_coord_to_screen_coord(Vector p);
Vector ga_win_screen_coord_to_inner_coord(Vector p);
Rendering
void ga_win_set_back_params(
int wid, Vector color, float alpha1, float alpha2);
void ga_win_set_front_color(int wid, Vector color);
void ga_win_set_front_color_default(int wid);
Vector ga_win_get_default_front_color();
void ga_win_set_char_size(int wid, float char_width, float char_height);
void ga_win_set_background(int wid, Vector color, float alpha);
void ga_win_set_background_default(int wid);
void ga_win_clear_depth_buffer_maybe();
void ga_win_line(
int wid, float x1, float y1, float x2, float y2,
Vector color);
void ga_win_line_rect(
int wid, float min_x, float min_y, float max_x, float max_y,
Vector color);
void ga_win_quad(
int wid, float min_x, float min_y, float max_x, float max_y,
string tex);
void ga_win_quad_two(
int wid, float min_x, float min_y, float max_x, float max_y,
string tex1 string tex2, float frac);
void ga_win_quad_color(
int wid, float min_x, float min_y, float max_x, float max_y,
Vector color);
void ga_win_quad_color_alpha(
int wid, float min_x, float min_y, float max_x, float max_y,
Vector color, float alpha);
CLASS ga_win_txt(
int wid, float min_x, float min_y, string txt);
CLASS ga_win_txt_alpha_bg(
int wid, float min_x, float max_x, float alpha, string txt);
CLASS ga_win_txt_center(
int wid, float min_y, string txt);
CLASS ga_win_txt_center_at_bg(
int wid, float center_x, float min_y, string txt);
void ga_win_txt_box(
int wid, string txt, bool go_back_msg);
float ga_win_get_center_text_min_x(float w, int num_chars);
Widgets
void ga_win_widget_go_back_button_start(
int wid, float x, float w, float h, string msg);
bool ga_win_widget_go_back_button_process_input(int wid);
void ga_win_widget_button_start(
int wid, int handle, float x, float y, float w, float h, string msg);
void ga_win_widget_button_center_x_at(int wid, int handle, float x);
void ga_win_widget_button_set_color(int wid, int handle, Vector color);
string ga_win_widget_button_get_text(int wid, int handle);
void ga_win_widget_button_set_text(int wid, int handle, string msg);
int ga_win_widget_button_process_input(int wid);
void ga_win_widget_button_end(int wid, int handle);
void ga_win_widget_small_list_start(
int wid, float min_y, float max_y,
float char_width, float char_height,
Vector txt_color, LIST items);
void ga_win_widget_small_list_set_use_nums(bool value);
int ga_win_widget_small_list_process_input(int wid);
string ga_win_widget_small_list_get_entry(int wid, int index);
int ga_win_widget_small_list_get_selected(int wid);
void ga_win_widget_small_list_set_selected(int wid, int sel_num);
void ga_win_widget_small_list_set_selected_by_substr(int wid, string substr);
void ga_win_widget_small_list_mute_sound(int wid, string which_sound);
void ga_win_widget_small_list_end(int wid);
void ga_win_widget_large_list_start(
int wid, float min_y, float max_y,
float char_w, float char_h, Vector text_color, LIST items);
void ga_win_widget_large_list_enable_scroll_bar(int wid, float x);
void ga_win_widget_large_list_set_scroll_y_min_max(int wid, float min_y, float max_y);
int ga_win_widget_large_list_process_input(int wid);
string ga_win_widget_large_list_get_entry(int wid, int index);
int ga_win_widget_large_list_get_selected(int wid);
void ga_win_widget_large_list_set_selected(int wid, string str);
void ga_win_widget_large_list_set_selected_by_num(int wid, int num);
void ga_win_widget_large_list_set_selected_by_substr(int wid, string substr);
void ga_win_widget_text_input_start(
int wid, float min_y, float char_width, float chat_height);
string ga_win_widget_text_input_process_input(int wid);
string ga_win_widget_text_input_get_text(int wid);
void ga_win_widget_text_input_set_text(int wid, string str);
string ga_win_widget_text_input_set_enable_enter(int wid, bool value);
void ga_win_widget_text_input_forbid_all_chars(int wid);
void ga_win_widget_text_input_set_char_allowed(
int wid, string char_str, bool value);
void ga_win_widget_mutable_text_box_start(
int wid, float min_x, float max_x, float min_y, float max_y,
float char_width, float char_height,
Vector txt_color, string init_str);
string ga_win_widget_mutable_text_box_get_text(int wid);
void ga_win_widget_mutable_text_box_set_text(int wid, string str);
void ga_win_widget_mutable_text_box_end(int wid);
Cursor
bool ga_win_get_cursor_enabled();
void ga_win_enable_cursor(bool value);
void ga_win_show_cursor_icon(bool value);
void ga_win_enable_hud_cursor(bool value);
Vector ga_win_get_cursor_pos(int wid);
Vector ga_win_get_cursor_diff(int wid);
void ga_win_scroll(int wid, float scroll_x, float scroll_y);
Vector ga_win_m_to_s(int wid, float x, float y);
Vector ga_win_s_to_m(int wid, float x, float y);
void ga_win_set_scroll_bounds(
int wid, float min_x, float min_y, float max_x, float max_y);
Input Without WID
bool ga_win_key_down(string key);
bool ga_win_mouse_down(bool left);
bool ga_win_mouse_down2(int button);
Input With WID
bool ga_win_key_pressed(int wid, string key);
bool ga_win_key_pressed_or_spammed(
int wid, string key, float init_wait, float subsequent_wait);
bool ga_win_key_released(int wid, string key);
bool ga_win_mouse_pressed(int wid, bool left);
bool ga_win_mouse_pressed2(int wid, int button);
bool ga_win_mouse_released(int wid, bool left);
bool ga_win_mouse_released2(int wid, int button);
bool ga_win_mouse_wheel_up(int wid);
bool ga_win_mouse_wheel_down(int wid);
Other Input Related
void ga_win_release_keys_that_are_down();