setPosition method

dynamic setPosition(
  1. dynamic x,
  2. dynamic y
)

Implementation

setPosition(x, y) {
  position["x"] = x;
  position["y"] = y;

  var width = size["width"]!;
  var height = size["height"]!;

  mesh.position.set(-innerWidth / 2 + width / 2 + x, innerHeight / 2 - height / 2 - y, 0);

  // if ( doRenderLabel ) labelMesh.position.set( mesh.position.x, mesh.position.y - scope.size.height / 2 + labelCanvas.height / 2, 0 );
}