TileUi

TileUiDemo.png

Purpose

Requires 'New Input System'

This is an example of how to use TpActionToTile and the TpInputActionToTile component as well as hovering for tooltips and hovering for animation.

On the left is an AnimatedButtonTile. It supports changing animation on hover and on click. It uses a simple event action which changes the value of the AsciiChar tile just above it.

Clicking on a number in the Keypad area will

  1. change color of the number for a few hundred mSec (this is set via a variable in the tile instance).
  2. make a noise using a callback to this component. The noise is different depending on if a tile was clicked or not.

The box next to the keypad is a toggle and the two sets of boxes underneath that are two sets of radio buttons. One uses tags and the other uses Zones to create a radio group.

The number dials comprise up/down arrows and a UiAsciiCharTile to show the number.
Clicking on the arrow buttons will make the numbers go up/down. That's done with ZoneActions. Each one of these buttons implements a 1x1 zone that's placed over the number tile that's between the buttons. You can see this with Painter's Edit mode: select one of these and click visualize in the Zone controls section.

The 'HZ' tiles are Hover Zones. These can be used for tooltips. In this example, they're used to print a description of the Control in the text box.

All of the "which tile is it" code etc is in TpActionToTile.cs which is managed by the TpInputActionToTile mono-component.


Revision #3
Created 13 July 2025 14:30:50 by Vonchor
Updated 22 July 2025 17:25:04 by Vonchor