This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::ObjectGui Class

Header: #include <UnigineObjects.h>
Inherits from: Object

This class allows to create a flat GUI object that is positioned in the world and to which different widgets are assigned to be displayed. Basically, ObjectGui is a flat display to which a player can come to and click some buttons. GUI objects can undergo postprocessing filtering, for example, blurring or any other one.

Notice
When you create an instance of the ObjectGui class, it is automatically associated with an instance of the Gui class.

See Also#

A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/objects/ folder:

ObjectGui Class

Members


static ObjectGuiPtr create ( float width, float height, const char * name = 0 ) #

Constructor. Creates a new GUI object with given properties.

Arguments

  • float width - Physical width of the new GUI object in units.
  • float height - Physical height of the new GUI object in units.
  • const char * name - Path to the folder with GUI skin (the RC file and textures). If no value is specified, the default gui skin will be used.

void setBackground ( bool background ) #

Sets a value indicating if the GUI background (black screen) should be rendered.

Arguments

  • bool background - true to render GUI background, false to keep it transparent.

bool isBackground ( ) const#

Returns a value indicating if GUI background (black screen) is rendered.

Return value

true if background is rendered; otherwise, false.

void setBillboard ( bool billboard ) #

Sets a value indicating if the GUI object should be a billboard.

Arguments

  • bool billboard - true to render the GUI object as a billboard; otherwise, false.

bool isBillboard ( ) const#

Returns a value indicating if the GUI object is a billboard.

Return value

true if GUI object is a billboard; otherwise, false.

void setControlDistance ( float distance ) #

Sets a distance at which the GUI becomes controllable.

Arguments

  • float distance - New distance in units. If a negative value is provided, 0 will be used instead.

float getControlDistance ( ) const#

Returns the distance, at which the GUI becomes controllable.

Return value

Distance in units.

void setDepthTest ( bool test ) #

Sets a value indicating if depth test should be used for the GUI object.

Arguments

  • bool test - true to use depth test; otherwise, false.

bool isDepthTest ( ) const#

Returns a value indicating if the GUI object uses depth test.

Return value

true if the GUI object uses depth test; otherwise, false.

Ptr<Gui> getGui ( ) const#

Returns a Gui instance associated with the object. This function is used when assigning a widget to the GUI object.
Notice
When you create an instance of the ObjectGui class, it is automatically associated with a Gui instance.

Return value

Gui smart pointer.

void setMouse ( const Math::Vec3 & p0, const Math::Vec3 & p1, int mouse_button, int mouse_show ) #

Sets mouse cursor position in the virtual control mode.

Arguments

  • const Math::Vec3 & p0 - Start point. A line segment between the start and the end points must intersect ObjectGui. The point of intersection determines x and y coordinates on the ObjectGui.
  • const Math::Vec3 & p1 - End point. A line segment between the start and the end points must intersect ObjectGui. The point of intersection determines x and y coordinates on the ObjectGui.
  • int mouse_button - Mouse button status. Set 1 to indicate that the button is clicked; otherwise, 0.
  • int mouse_show - Mouse cursor status. Set 1 to show mouse cursor; otherwise, 0.

void setMouseMode ( int mode ) #

Sets mouse mode. This method can be used to set a virtual control mode for the mouse.

Arguments

  • int mode - Mouse mode. One of the MOUSE_* variables.

int getMouseMode ( ) const#

Returns the current mouse mode.

Return value

Mouse mode. One of the MOUSE_* variables.

void setMouseShow ( bool show ) #

Sets a value indicating if the mouse cursor should be rendered in the GUI object.

Arguments

  • bool show - true to render the mouse cursor; otherwise, false.

bool isMouseShow ( ) const#

Returns a value indicating if the mouse cursor is rendered in the GUI object.

Return value

true if the cursor is rendered; otherwise, false.

float getPhysicalHeight ( ) const#

Returns the physical height of the GUI object.

Return value

Height in units.

void setPhysicalSize ( float width, float height ) #

Sets physical dimensions of the GUI object.

Arguments

  • float width - New width in units. If a negative value is provided, 0 will be used instead.
  • float height - New height in units. If a negative value is provided, 0 will be used instead.

float getPhysicalWidth ( ) const#

Returns the physical width of the GUI object.

Return value

Width in units.

void setPolygonOffset ( float offset ) #

Sets an offset of the GUI object above the background to avoid z-fighting.

Arguments

  • float offset - Polygon offset in units. If a negative value is provided, 0 will be used instead.

float getPolygonOffset ( ) const#

Returns an offset of the GUI object above the background to avoid z-fighting.

Return value

Polygon offset in units.

int getScreenHeight ( ) const#

Returns the screen height of the GUI object.

Return value

Height in pixels.

void setScreenSize ( int width, int height ) #

Sets screen dimensions of the GUI object.

Arguments

  • int width - New width in pixels. If a negative value is provided, 0 will be used instead.
  • int height - New height in pixels. If a negative value is provided, 0 will be used instead.

int getScreenWidth ( ) const#

Returns the screen width of the GUI object.

Return value

Width in pixels.

static int type ( ) #

Returns the type of the node.

Return value

Object type identifier.
Last update: 2023-06-23
Build: ()