Provides controls for transforming position, size, and rotation of Pixi.js Display Objects.
- Transformations are relative to the registration point (ob.regX, obj.regY), which you can choose.
- Un-obtrusive to your pixijs project scene. The tool sits in it's own container layer.
See the tool in action at: https://jedateach.github.io/pixijs-free-transform-tool
In order to use this tool you have to do the following:
-
add a new layer to your stage in top of everything as the follwing:
var top = new PIXI.Container(); app.stage.addChild(top);
-
add the transform tool inside the top layer as the follwing:
var selectTool = new PIXI.util.FreeTransformTool(); selectTool.name = "transform"; top.addChild(selectTool);
-
to select any object for example when the user click on that object as the following:
object.on("pointertap", function (evt) { selectTool.select(evt.currentTarget); });
-
to unselect object for example when the user click on the stage as the following:
stage.addEventListener("click", function () { selectTool.unselect(); });