
|
|
This file was automatically generated from diguyViewLabel.h. Do not edit this file directly; the changes will be lost.Includes: diguy_constants.h | diguy_typedefs.h | declspec_diguy.h
Contents:
typedef diguyViewLabelJustification
|
typedef int diguyViewLabelJustification;
enumeration
|
enum { DIGUY_GRAPHICS_LABEL_JUSTIFIED_LEFT = 0, DIGUY_GRAPHICS_LABEL_JUSTIFIED_BOTTOM = 0, DIGUY_GRAPHICS_LABEL_JUSTIFIED_RIGHT = 1, DIGUY_GRAPHICS_LABEL_JUSTIFIED_TOP = 1, DIGUY_GRAPHICS_LABEL_JUSTIFIED_CENTER = 2 };
class diguyViewLabel
|
class BDI_DECLSPEC_diguy diguyViewLabel { public: const char* get_name(); void set_text(const char* text); const char* get_text(); void set_text_color(float r, float g, float b, float a, float interp_time = 0.0f); void set_text_shadow_color(float r, float g, float b, float a, float interp_time = 0.0f); void set_text_shadow_enabled(int text_shadow_enabled); void set_text_justification(diguyViewLabelJustification just); diguyViewLabelJustification get_text_justification(); void set_text_offset_x(int offset); int get_text_offset_x(); void set_text_offset_y(int offset); int get_text_offset_y(); void set_x(float screen_x_offset, float interp_time = 0.0f); float get_x(); void set_y(float screen_y_offset, float interp_time = 0.0f); float get_y(); void set_negative_wraps_x(int wrap); int get_negative_wraps_x(); void set_negative_wraps_y(int wrap); int get_negative_wraps_y(); void set_window_justification_x(diguyViewLabelJustification just); diguyViewLabelJustification get_window_justification_x(); void set_window_justification_y(diguyViewLabelJustification just); diguyViewLabelJustification get_window_justification_y(); void set_minimum_width(int min_x); int get_minimum_width(); void set_minimum_height(int min_y); int get_minimum_height(); int get_width(); int get_height(); void set_full_window(int full_window); int get_full_window(); void reset(); void set_visible(int visible); int get_visible(); void set_background_color(float r, float g, float b, float a, float interp_time = 0.0f); void set_background_image(const char* filename); void set_background_enabled(int background_enabled); void set_border_color(float r, float g, float b, float a, float interp_time = 0.0f); void set_margin_size(int margin_size); void set_border_enabled(int border_enabled); void enable_bar_graph(int num_lines, int lines_are_vertical = 1, int line_thickness = 10, int space_between_lines = 2, int derive_minimum_label_size = 1); void disable_bar_graph(); int get_bar_graph_num_lines(); int get_bar_graph_lines_are_vertical(); void set_bar_graph_line_color(int line_number, float r, float g, float b, float a); void set_bar_graph_line_magnitude_ratio(int line_number, float ratio); void set_bar_graph_line_magnitude_pixels(int line_number, int pixels); void set_is_temporary(int temporary); int get_is_temporary(); void set_draw_limit(float draw_limit); float get_draw_limit(); void set_is_clickable(int is_clickable); int get_is_clickable(); void set_is_noise(int is_noise); int get_is_noise(); const char* get_type_name(); enum { CALLBACK_ID_USER_SELECTED = 1, CALLBACK_ID_USER_UNSELECTED, CALLBACK_ID_IGUY_INTERACT }; int add_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int remove_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); #ifdef CPLUSPLUS_ONLY int add_callback(int callback_id, diguyViewLabelCallback* callback, void* callback_params = NULL, void* callback_user_data = NULL); int remove_callback(int callback_id, diguyViewLabelCallback* callback); int remove_callback_with_user_data(int callback_id, void* callback_user_data);
| General Functions |
function diguyViewLabel::get_name |
Prototype:
Description:const char* get_name();
Returns the name of the object. This pointer will never be NULL.Returns:
name of the objectCallable From:
- C++
- Script
| Text Functions |
function diguyViewLabel::set_text |
Prototype:
Description:void set_text(const char* text);
Sets the text on the label.Callable From:
- C++
- Script
function diguyViewLabel::get_text |
Prototype:
Description:const char* get_text();
Returns the text on the label.Returns:
pointer to NULL-terminated stringCallable From:
- C++
- Script
function diguyViewLabel::set_text_color |
Prototype:
Description:void set_text_color(float r, float g, float b, float a, float interp_time = 0.0f);
Similar to set_background_color(), but sets the color of the label text.
Default color is solid white (1, 1, 1, 1).Callable From:
- C++
- Script
function diguyViewLabel::set_text_shadow_color |
Prototype:
Description:void set_text_shadow_color(float r, float g, float b, float a, float interp_time = 0.0f);
Similar to set_background_color(), but sets the shadow color of the label text.
Default color is solid black (0, 0, 0, 1).Callable From:
- C++
- Script
function diguyViewLabel::set_text_shadow_enabled |
Prototype:
Description:void set_text_shadow_enabled(int text_shadow_enabled);
Enables or disables text shadow. Default is 0 (disabled).Arguments:
Callable From:
text_shadow_enabled pass 1 to enable shadow, 0 to disable
- C++
- Script
function diguyViewLabel::set_text_justification |
Prototype:
Description:void set_text_justification(diguyViewLabelJustification just);
Sets how the label text is justified, possible values are:
- DIGUY_GRAPHICS_LABEL_JUSTIFIED_LEFT - DIGUY_GRAPHICS_LABEL_JUSTIFIED_RIGHT - DIGUY_GRAPHICS_LABEL_JUSTIFIED_CENTER
Depending on how the flag is set the text will either draw flowing to the right of the current x. The left of the current x or centered above x.Callable From:
- C++
- Script
function diguyViewLabel::get_text_justification |
Prototype:
Description:diguyViewLabelJustification get_text_justification();
Returns how the text on the label is being justified.Returns:
One of the following values:
Callable From:
- C++
- Script
function diguyViewLabel::set_text_offset_x |
Prototype:
Description:void set_text_offset_x(int offset);
Adds an x offset to the text part of the label.Callable From:
- C++
- Script
function diguyViewLabel::get_text_offset_x |
Prototype:
Returns:int get_text_offset_x();
returns the x offset of the text part of the label.Callable From:
- C++
- Script
function diguyViewLabel::set_text_offset_y |
Prototype:
Description:void set_text_offset_y(int offset);
Adds a y offset to the text part of the label.Callable From:
- C++
- Script
function diguyViewLabel::get_text_offset_y |
Prototype:
Returns:int get_text_offset_y();
returns the y offset of the text part of the label.Callable From:
- C++
- Script
| Position Functions |
function diguyViewLabel::set_x |
Prototype:
Description:void set_x(float screen_x_offset, float interp_time = 0.0f);
Sets the x location of the label. Positive numbers are relative to the left side of the screen; negative numbers are relative to the right side of the screen.
The optional interp_time argument will make the label animate to its new location.Arguments:
Callable From:
screen_x_offset x offset in pixels interp_time amount of time in seconds used to shift to new position
- C++
- Script
function diguyViewLabel::get_x |
Prototype:
Description:float get_x();
Gets the x location of the label.
Note: this will return the current x value, not the desired one.Callable From:
- C++
- Script
function diguyViewLabel::set_y |
Prototype:
Description:void set_y(float screen_y_offset, float interp_time = 0.0f);
Sets the y location of the label. Positive numbers are relative to the bottom of the screen; negative numbers are relative to the top of the screen.
The optional interp_time argument will make the label animate to its new location.Arguments:
Callable From:
screen_y_offset y offset in pixels interp_time amount of time in seconds used to shift to new position
- C++
- Script
function diguyViewLabel::get_y |
Prototype:
Description:float get_y();
Gets the y location of the label.
Note: this will return the current y value, not the desired one.Callable From:
- C++
- Script
function diguyViewLabel::set_negative_wraps_x |
Prototype:
Description:void set_negative_wraps_x(int wrap);
Sets if having a negative value wraps to the other side of the viewport. Defaults to 1.Arguments:
Callable From:
wrap 1 if x should wrap; 0 if not
- C++
- Script
function diguyViewLabel::get_negative_wraps_x |
Prototype:
Returns:int get_negative_wraps_x();
1 if x wraps its offset when negativeCallable From:
- C++
- Script
function diguyViewLabel::set_negative_wraps_y |
Prototype:
Description:void set_negative_wraps_y(int wrap);
Sets if having a negative value wraps to the other side of the viewport. Defaults to 1.Arguments:
Callable From:
wrap 1 if y should wrap; 0 if not
- C++
- Script
function diguyViewLabel::get_negative_wraps_y |
Prototype:
Returns:int get_negative_wraps_y();
1 if y wraps its offset when negativeCallable From:
- C++
- Script
function diguyViewLabel::set_window_justification_x |
Prototype:
Description:void set_window_justification_x(diguyViewLabelJustification just);
Sets how the label is positioned relative to the window, possible values are:
Depending on how the flag is set the x offset will be measured from the right of the screen, the left or from the center of the window.Callable From:
- C++
- Script
function diguyViewLabel::get_window_justification_x |
Prototype:
Returns:diguyViewLabelJustification get_window_justification_x();
label's x positioning parameter described aboveCallable From:
- C++
- Script
function diguyViewLabel::set_window_justification_y |
Prototype:
Description:void set_window_justification_y(diguyViewLabelJustification just);
Sets how the label is positioned relative to the window. Possible values are:
Depending on how the flag is set the y offset will be measured from the bottom of the screen, from the top or from the center of the window.Callable From:
- C++
- Script
function diguyViewLabel::get_window_justification_y |
Prototype:
Returns:diguyViewLabelJustification get_window_justification_y();
label's y positioning parameter described aboveCallable From:
- C++
- Script
function diguyViewLabel::set_minimum_width |
Prototype:
Description:void set_minimum_width(int min_x);
Sets the minimum width of the label. The default is 0, which will size the label width to fit the label text or bar graph.Arguments:
Callable From:
min_x minimum width, in pixels
- C++
- Script
function diguyViewLabel::get_minimum_width |
Prototype:
Returns:int get_minimum_width();
minimum width of the label, as set by set_minimum_width()Callable From:
- C++
- Script
function diguyViewLabel::set_minimum_height |
Prototype:
Description:void set_minimum_height(int min_y);
Similar to set_minimum_width(), but sets minimum label height.
function diguyViewLabel::get_minimum_height |
Prototype:
Description:int get_minimum_height();
Similar to set_minimum_height(), but returns minimum label height.
function diguyViewLabel::get_width |
Prototype:
Returns:int get_width();
the current label widthCallable From:
- C++
- Script
function diguyViewLabel::get_height |
Prototype:
Returns:int get_height();
the current label heightCallable From:
- C++
- Script
function diguyViewLabel::set_full_window |
Prototype:
Description:void set_full_window(int full_window);
Turns the label into a full-window overlay. This can be useful for things like Heads-Up Displays (HUDs).
If there is a background image (see set_background_image()), the image will be scaled to fit the entire screen.
Default is 0 (not full-window). Note: turning a label into a full window will automatically make it non-clickable.Arguments:
Callable From:
full_window pass 1 for full-window, 0 for not full-window
- C++
- Script
function diguyViewLabel::get_full_window |
Prototype:
Returns:int get_full_window();
whether label is full-window, as set by set_full_window()Callable From:
- C++
- Script
function diguyViewLabel::reset |
Prototype:
Description:void reset();
Resets the parameters of the label to the values from the constructor.Callable From:
- C++
- Script
function diguyViewLabel::set_visible |
Prototype:
Description:void set_visible(int visible);
Sets the visibility of a label. Default is 1 (visible).Arguments:
Callable From:
visible pass 1 to make label visible, 0 for invisible
- C++
- Script
function diguyViewLabel::get_visible |
Prototype:
Returns:int get_visible();
visibility of label, as set by set_visible()Callable From:
- C++
- Script
| Background Functions |
function diguyViewLabel::set_background_color |
Prototype:
Description:void set_background_color(float r, float g, float b, float a, float interp_time = 0.0f);
Sets the color of the label background.
The optional interp_time argument will make the label gradually shift to its new color.Arguments:
r, g, b, a RGBA values of new color, between 0.0 and 1.0 interp_time amount of time in seconds used to shift to new color Default color is translucent blue (0, 0, 0.3, 0.7).Callable From:
- C++
- Script
function diguyViewLabel::set_background_image |
Prototype:
Description:void set_background_image(const char* filename);
Sets the background image of the label. The file will be looked for in $DIGUYcustomgeometry/rgb first, then in $DIGUYgeometryrgb.
The default is no background image.Callable From:
- C++
- Script
function diguyViewLabel::set_background_enabled |
Prototype:
Description:void set_background_enabled(int background_enabled);
Enables or disables label background. Default is 1 (enabled).Arguments:
Callable From:
background_enabled pass 1 to enable shadow, 0 to disable
- C++
- Script
| Border Functions |
function diguyViewLabel::set_border_color |
Prototype:
Description:void set_border_color(float r, float g, float b, float a, float interp_time = 0.0f);
Similar to set_border_color(), but sets the border color of the label background.
Default color is translucent white (1, 1, 1, 0.7).
Callable From:
r, g, b, a RGBA values of new color, between 0.0 and 1.0 interp_time amount of time in seconds used to shift to new color
- C++
- Script
function diguyViewLabel::set_margin_size |
Prototype:
Description:void set_margin_size(int margin_size);
Sets the margin, of the label. Default is 6 pixels.Arguments:
Callable From:
margin_size margin size in pixels
- C++
- Script
function diguyViewLabel::set_border_enabled |
Prototype:
Description:void set_border_enabled(int border_enabled);
Sets if the border should be visible. Default is 1 (enabled).Arguments:
Callable From:
border_enabled pass 1 to enable, 0 to disable
- C++
- Script
| Bar Graph Functions |
These functions allow view labels to be used as bar graph-like visuals. This can be useful for providing a graphical representation for various parameters in a scenario; for example, to show the level of different control parameters of a DI-Guy AI Agent.
Lua Example:
local label_bar_graph = this_scenario:find_or_create_label("bar_graph"); -- set position and minimum sizes label_bar_graph:set_x(10.0); label_bar_graph:set_y(20.0); label_bar_graph:set_minimum_width(10.0); label_bar_graph:set_minimum_height(100.0); -- enable bar graph functionality: -- 4 bars/lines -- lines are vertical -- lines are 8 pixels wide -- 4 pixels between lines label_bar_graph:enable_bar_graph(4, 1, 10, 4); -- set bar graph line colors label_bar_graph:set_bar_graph_line_color(0, 1.0, 0.0, 0.0, 1.0); -- red label_bar_graph:set_bar_graph_line_color(1, 0.0, 1.0, 0.0, 1.0); -- green label_bar_graph:set_bar_graph_line_color(2, 0.0, 0.0, 1.0, 1.0); -- blue label_bar_graph:set_bar_graph_line_color(3, 1.0, 1.0, 0.0, 1.0); -- yellow -- set bar graph line magnitudes (height in this case) label_bar_graph:set_bar_graph_line_magnitude_ratio(0, 1.0); label_bar_graph:set_bar_graph_line_magnitude_ratio(1, 0.25); label_bar_graph:set_bar_graph_line_magnitude_ratio(2, 0.5); label_bar_graph:set_bar_graph_line_magnitude_ratio(3, 1.0);
function diguyViewLabel::enable_bar_graph |
Prototype:
Description:void enable_bar_graph(int num_lines, int lines_are_vertical = 1, int line_thickness = 10, int space_between_lines = 2, int derive_minimum_label_size = 1);
Enables bar graph functionality for this label. Note that this doesn't automatically turn off text or background image.
Label position and minimum sizes should be set before this is called.Arguments:
Callable From:
num_lines number of lines/bars that will be shown lines_are_vertical pass 1 for lines to go bottom to top, 0 for lines to go left to right line_thickness line thickness, in pixels space_between_lines space between lines, in pixels derive_minimum_label_size derive and set the minimum label size, as if set_minimum_width() and set_minimum_height() were called to fit this bar graph
- C++
- Script
function diguyViewLabel::disable_bar_graph |
Prototype:
Description:void disable_bar_graph();
Disables bar graph functionality for this label. Bar graph lines will no longer be visible.
function diguyViewLabel::get_bar_graph_num_lines |
Prototype:
Returns:int get_bar_graph_num_lines();
number of bars/lines in bar graph
function diguyViewLabel::get_bar_graph_lines_are_vertical |
Prototype:
Returns:int get_bar_graph_lines_are_vertical();
1 if lines to go bottom to top, 0 if lines to go left to right
function diguyViewLabel::set_bar_graph_line_color |
Prototype:
Description:void set_bar_graph_line_color(int line_number, float r, float g, float b, float a);
Sets the color of the specified line.
function diguyViewLabel::set_bar_graph_line_magnitude_ratio |
Prototype:
Description:void set_bar_graph_line_magnitude_ratio(int line_number, float ratio);
Sets how much of the usable space (bottom to top for vertical lines, left to right for horizontal lines) a line will take up at its maximum length.Arguments:
line_number line to change ratio how much of the line to display, from 0 (none) to 1 (all) For example, if, based on the label height, the bar graph has at most 20 pixels to show each line, passing 0.5 for ratio will fill 10 pixels with the line color, while passing 1.0 for ratio will fill all 20 pixels.
function diguyViewLabel::set_bar_graph_line_magnitude_pixels |
Prototype:
Description:void set_bar_graph_line_magnitude_pixels(int line_number, int pixels);
Similar to set_bar_graph_line_magnitude_ratio(), but sets the length of the line based on absolute pixels.
Note that care should be taken to not overrun the current height or width of the label when using this function.Arguments:
line_number line to change pixels line length in pixels
| Misc Functions |
function diguyViewLabel::set_is_temporary |
Prototype:
Description:void set_is_temporary(int temporary);
Sets if a label is temporary. Temporary labels are destroyed on scenario reset, and will not re-appear unless they are recreated.
Pass 1 to make label temporary, 0 to make it permanent.
function diguyViewLabel::get_is_temporary |
Prototype:
Returns:int get_is_temporary();
1 if a label is temporary, 0 if not; see set_is_temporary()
function diguyViewLabel::set_draw_limit |
Prototype:
Description:void set_draw_limit(float draw_limit);
Sets how far away the label will be drawn.Arguments:
Callable From:
draw_limit -1 to always draw, otherwise will draw till draw_limit is reached
- C++
- Script
function diguyViewLabel::get_draw_limit |
Prototype:
Description:float get_draw_limit();
Gets how far away the label will be drawn. Defaults to -1 which always draws.Callable From:
- C++
- Script
function diguyViewLabel::set_is_clickable |
Prototype:
Description:void set_is_clickable(int is_clickable);
Sets if the label is clickable with the mouse.
For character labels this is the equivalent of clicking on the character itself, and can trigger the CALLBACK_ID_IGUY_INTERACT callback.
For screen labels it triggers CALLBACK_ID_USER_SELECTED on mouse down, and CALLBACK_ID_USER_UNSELECTED on mouse up.
By default labels are clickable.Arguments:
Callable From:
is_clickable pass 1 to enable, 0 to disable
- C++
- Script
function diguyViewLabel::get_is_clickable |
Prototype:
Returns:int get_is_clickable();
1 if label responds to mouse clicks, 0 if not; see set_is_clickable()Callable From:
- C++
- Script
function diguyViewLabel::set_is_noise |
Prototype:
Description:void set_is_noise(int is_noise);
Sets if the label is "noise".
The textures of noise labels with be shifted every frame.
By default labels not noise.Arguments:
Callable From:
is_noise pass 1 to enable, 0 to disable
- C++
- Script
function diguyViewLabel::get_is_noise |
Prototype:
Returns:int get_is_noise();
1 if label textures shift every frame, 0 if not; see set_is_noise()Callable From:
- C++
- Script
function diguyViewLabel::get_type_name |
Prototype:
Resturs:const char* get_type_name();
NULL-terminated string "label"
enumeration |
Description:enum { CALLBACK_ID_USER_SELECTED = 1, CALLBACK_ID_USER_UNSELECTED, CALLBACK_ID_IGUY_INTERACT };
This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script().Usable From:
- C++
- Script
function diguyViewLabel::add_callback_script |
Prototype:
Description:int add_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function adds a user callback script. Callback scripts can be removed with remove_callback_script().Arguments:
callback_id integer id of the callback callback_script script text of callback to be added callback_script_type the type of script contained in callback_script If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.lua specific:
When the script is called, the object for which it is being called will be in the callback_object global.
To pass NULL when calling from a lua script, use nil.Returns:
0 on success, -1 on failureCallable From:
lua Example:
- C++
- Script
------------------------------------------------------------------------------ local on_clicked_callback = [[ local la_name = callback_object:get_name(); bdi_log_print(BDI_LOG_WARN, "Calling on_click for label ".. la_name .. "'.\n"); ]] ------------------------------------------------------------------------------ label:add_callback_script(diguyViewLabel_CALLBACK_ID_USER_UNSELECTED, on_clicked_callback, "lua");
function diguyViewLabel::remove_callback_script |
Prototype:
Description:int remove_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a user callback script previously added with add_callback_script().Arguments:
callback_id integer id of the callback callback_script script text of callback previously added callback_script_type the type of script contained in callback_script If NULL is passed for callback_script, all callback scripts whose ids match callback_id and whose types match callback_script_type will be removed.
If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.lua specific:
To pass NULL when calling from a lua script, use nil.Returns:
0 on success, -1 on failureCallable From:
Lua Example:
- C++
- Script
-- -- Remove all callback scripts with id -- diguyViewLabel_CALLBACK_ID_USER_UNSELECTED -- label:remove_callback_script(diguyViewLabel_CALLBACK_ID_USER_UNSELECTED, nil, "lua");
function diguyViewLabel::add_callback |
Prototype:
Description:int add_callback(int callback_id, diguyViewLabelCallback* callback, void* callback_params = NULL, void* callback_user_data = NULL);
This function adds a user callback. Callbacks can be removed with remove_callback() or remove_callback_with_user_data().Arguments:
Returns:
callback pointer to function with prototype diguyViewLabelCallback (typedefed above) callback_id integer id of when this callback is to be called callback_params not currently used; pass NULL callback_user_data pointer for user's own use; DI-Guy will do nothing to the contents of this pointer beyond passing it back when the callback is invoked
0 on success, -1 on failureCallable From:
- C++
function diguyViewLabel::remove_callback |
Prototype:Description:
Description:int remove_callback(int callback_id, diguyViewLabelCallback* callback);
This function removes a user callback. All callbacks matching the specified callback_id and callback function will be removed.Arguments:
Returns:
callback_id integer id of when this callback is to be called callback pointer to function with prototype diguyViewLabelCallback (typedefed above)
0 on success, -1 on failureCallable From:
- C++
This function removes a user callback. All callbacks matching the specified callback_id and callback_user_data pointer will be removed.
Arguments:
Returns:
callback_id integer id of when this callback is to be called callback_user_data pointer for user's own use
0 on success, -1 on failure
Callable From:
- C++
function diguyViewLabel::remove_callback_with_user_data |
Prototype:
int remove_callback_with_user_data(int callback_id, void* callback_user_data);
ALL RIGHTS RESERVED.
These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.
Contractor/Manufacturer is:
Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.