This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine.ObjectGui Class

Inherits: 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

Properties

int ScreenHeight#

The screen height of the gui object.

int ScreenWidth#

The screen width of the gui object.

float PhysicalHeight#

The physical height of the gui object.

float PhysicalWidth#

The physical width of the gui object.

float PolygonOffset#

An offset of the gui object above the background to avoid z-fighting.
set
Sets an offset of the GUI object above the background to avoid z-fighting.
set value - Polygon offset in units. If a negative value is provided, 0 will be used instead.

float ControlDistance#

The distance at which the gui becomes controllable.
set
Sets a distance at which the GUI becomes controllable.
set value - New distance in units. If a negative value is provided, 0 will be used instead.

int MouseMode#

The current mouse mode.
set
Sets mouse mode. This method can be used to set a virtual control mode for the mouse.
set value - Mouse mode. One of the MOUSE_* variables.

int MouseShow#

A value indicating if the mouse cursor is rendered in the gui object.
set
Sets a value indicating if the mouse cursor should be rendered in the GUI object.
set value - Positive number to render the mouse cursor; otherwise, 0.

int DepthTest#

A value indicating if the gui object uses depth test.
set
Sets a value indicating if depth test should be used for the GUI object.
set value - Positive number to use depth test; otherwise, 0.

int Background#

A value indicating if gui background (black screen) is rendered.
set
Sets a value indicating if the GUI background (black screen) should be rendered.
set value - Positive number to render GUI background, 0 to keep it transparent.

bool Billboard#

A value indicating if the gui object is a billboard.
set
Sets a value indicating if the GUI object should be a billboard.
set value - true to render the GUI object as a billboard; otherwise, false.

Members


static ObjectGui ( float width, float height, string 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.
  • string 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.

Gui GetGui ( ) #

Returns a Gui instance associated with the object.

Return value

Gui smart pointer.

void SetMouse ( vec3 p0, vec3 p1, int mouse_button, int mouse_show ) #

Sets mouse cursor position in the virtual control mode.

Arguments

  • 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.
  • 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 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.

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.

static int type ( ) #

Returns the type of the node.

Return value

Object type identifier.
Last update: 2021-02-17
Build: ()