Pular para o conteúdo principal

UIDrivingWheel

Volante que gera um eixo continuo baseado na rotacao.

Criar no Editor

  1. Garanta que existe um UIController na cena.
  2. Crie um GameObject e adicione UIRect.
  3. Adicione o componente UIDrivingWheel.

Como Usar

  1. Pegue o componente com myObject.findComponent(UIDrivingWheel.class).
  2. Leia e altere as propriedades do componente para controlar o comportamento.
  3. Teste o input ou layout no modo Play.

Exemplo em Java

SpatialObject myObject = /* your object */;
UIDrivingWheel comp = myObject.findComponent(UIDrivingWheel.class);
if (comp != null) {
Texture tex = /* load texture */ null;
// read the value value:
float valueValue = comp.value;
// read the angle value:
float angleValue = comp.angle;

// set the lerp value:
comp.lerp = 1f;
// read the lerp value:
float lerpValue = comp.lerp;

// set the maxAngle value:
comp.maxAngle = 1f;
// read the maxAngle value:
float maxAngleValue = comp.maxAngle;
// read the pressed value:
boolean pressedValue = comp.pressed;
// read the down value:
boolean downValue = comp.down;
// read the up value:
boolean upValue = comp.up;

// set the color value:
comp.color = new Color(255, 255, 255, 255);
// read the color value:
Color colorValue = comp.color;

// set the texture value:
comp.texture = tex;
// read the texture value:
Texture textureValue = comp.texture;

}