class MAGES::DynamicLabel

Overview

A simple and customizable label that can follow (or not) the facing direction of the camera. More…

class DynamicLabel: public MonoBehaviour
{
public:
    // classes

    class Data;

    // methods

    void Refresh();
    DynamicLabel Text(string text);
    DynamicLabel Pivot(Vector2 pivot);
    DynamicLabel Pivot(float x, float y);
    DynamicLabel SetData(Data data);
    DynamicLabel.Data GetData();
    GameObject Proxy();
};

Detailed Documentation

A simple and customizable label that can follow (or not) the facing direction of the camera.

The label builds a new gameObject that tracks the position of this object and renders a text. Since many different transformations may be applied to this gameObject, the label modifies a different GameObject that is created at runtime.

Methods

void Refresh()

Refresh the layout of the label.

DynamicLabel Text(string text)

Sets the text of the label.

Parameters:

text

The text.

Returns:

Self.

DynamicLabel Pivot(Vector2 pivot)

Sets the pivot of the underlying canvas of the label.

Parameters:

pivot

The new pivot.

Returns:

Self.

DynamicLabel Pivot(float x, float y)

Sets the pivot of the underlying canvas of the label.

Parameters:

x

Pivot.x.

y

Pivot.y.

Returns:

Self.

DynamicLabel SetData(Data data)

Sets the data for the label.

Parameters:

data

The new data.

Returns:

Self.

DynamicLabel.Data GetData()

Gets the data for the label.

Returns:

The data.

GameObject Proxy()

Gets the proxy game object.

Returns:

The gameobject.