stage-js
Version:
2D HTML5 Rendering and Layout
25 lines (20 loc) • 403 B
JavaScript
import Stage from "../../src";
import "../common/texture";
let stage = Stage.mount();
let math = Stage.math;
stage.viewbox(200, 200);
Stage.sprite("box")
.stretch()
.appendTo(stage)
.pin({
width: 64,
height: 64,
align: 0.5,
})
.on("click", function () {
this.tween().pin({
width: math.random(32, 96),
height: math.random(32, 96),
});
return true;
});