This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
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
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Field Class

Warning
Game Framework is deprecated and no longer supported. We can't guarantee the stable work of the framework.

Describes the Field methods of the Entity.

The Field class implementation can found in the data/framework/game/fields.h file.

Field Class

Members


void setClassName(string name)

Sets a field class name.

Arguments

  • string name - Field class name.

string getClassName ()

Returns a field class name.

Return value

Field class name.

void setGetter(string func_name)

Sets a getter function.

Arguments

  • string func_name - Getter function name.

int getGetterId()

Returns a getter function ID.

Return value

ID of the getter function.

string getGetterName()

Returns a getter function name.

Return value

Getter function name.

void setName(string name)

Sets a field name.

Arguments

  • string name - Field name.

string getName()

Returns a field name.

Return value

Field name.

int getNumSwitchItems()

Returns the number of switch items in the Field.

Return value

Number of switch items. If the field type is not FIELD_SWITCH, then function returns 0.

void setSetter(string func_name)

Sets a setter function.

Arguments

  • string func_name - Setter function name.

int getSetterId()

Returns a setter function ID.

Return value

ID of the setter function.

string getSetterName()

Returns a setter function name.

Return value

Setter function name.

void setSwitchDefault(int value)

Sets the default switch value.

Arguments

  • int value - Default switch value.

int getSwitchDefault()

Returns the default switch value.

Return value

Default switch value.

string getSwitchItem(int i)

Returns a switch item name by its number.

Arguments

  • int i - Switch item number.

Return value

Switch item name. If the field type is not FIELD_SWITCH, then function returns an empty string ("").

void setSwitchItems(string items)

Sets switch items for the field.

Arguments

  • string items - Comma-separated switch items.

void setType(int type)

Sets one of the FIELD_* types.

Arguments

  • int type - Field type.

int getType()

Returns one of the FIELD_* types.

Return value

Field type.

Field(variable instance)

Constructor. Creates a new Field class instance.

Arguments

  • variable instance - A user class instance with fields methods or a user class name.

int FIELD_COLOR

Description

Color field type.

int FIELD_DOUBLE

Description

Double field type.

int FIELD_FLOAT

Description

Float field type.

int FIELD_INT

Description

Integer field type.

int FIELD_STRING

Description

String field type.

int FIELD_SWITCH

Description

Switch field type.

int FIELD_TOGGLE

Description

Toggle field type.

int FIELD_VEC3

Description

Vec3 field type.

int FIELD_VEC4

Description

Vec4 field type.
Last update: 2017-07-03
Build: ()