1. Home
  2. Chameleon UI
  3. Runtime API

Runtime API

To use the Chameleon UI API add the following namespaces to your script:

Transitions

Chameleon UI offers methods to traverse the UI Framings on all the UI Groups contained by the UI. The editor friendly way to do this is to attach a method from the Chameleon UI Controller GameObject to the OnClick() event of a UI Button.

Go forward to the “PlayCanvas” UI Framing.

Go back to the previous UI Framing in the stack.

Notice the parameter to take is the name of the UI Framing to transition to. The other option to call for the transition from code by using the methods offered by the UIController component.

void PositionAt (string framingName)
void PositionAt (int framingIndex)
void PositionAt (string framingName, int groupIndex)
void PositionAt (int framingIndex, int groupIndex)

Places the UI view at the specified framing either by either its name or its index in the framings list immediately when called, so the transition does not take the time parameter for transitions in account. When no groupIndex parameter is used the transition is applied to the main UI Group, if this parameter is present then the index of the target UI Group should within the range of the groups list.

Use it if you want to: position the UI view at a particular framing instantly, not adding to the navigation stack.

By default the UI Chameleon Controller does not place the UI view on a particular UI Framing when initialized, so PositionAt is useful to call when a scene get initialized at the Start() method of a scene manager object.

void GoTo (string framingName)
void GoTo (int framingIndex)
void GoTo (string framingName, int groupIndex)
void GoTo (int framingIndex, int groupIndex)

Moves the UI view to the specified framing either by its name or its index in the framings list making a full transition, so the time parameter gets taken in account. This transition does not add up to the navigation framing stack, so this step will not count when calling GoBack on the group.

Use it if you want to: position the UI view at a particular framing making a transition, not adding to the navigation stack.

void GoForward (string framingName)
void GoForward (int framingIndex)
void GoForward (string framingName, int groupIndex)
void GoForward (int framingIndex, int groupIndex)

Moves the UI to the specified framing using its name or its index in the framings list making a full transition. This method adds the transition to the navigation framing stack, so this step will count when calling GoBack on the group.

Use it if you want to: advance the UI view to a particular framing making a transition, adding the step to the navigation stack.

void GoBack ()
void GoBack (int groupIndex)

Removes the last framing on the navigation framing stack and moves the UI view to the previous framing in the stack. Using the parameter-less method applies the transition to the main group.

Use it if you want to: go back in the navigation stack.

void GoBackTo (string framingName)
void GoBackTo (int framingIndex)
void GoBackTo (string framingName, int groupIndex)
void GoBackTo (int framingIndex, int groupIndex)

Moves the UI back to the specified framing using its name or its index in the framings list making a full transition IF present in the navigation framing stack. This method removes all the entries after the specified framing in the navigation stack.

Use it if you want to: go back in the navigation stack to a specific framing.

 

Was this article helpful to you? Yes No

How can we help?