Converts a pixi.js Rectangle to the plain Rect shape public APIs use. Internal to two-d; a game never constructs a pixi.js Rectangle to call this.
pixi.js
Rectangle
Rect
two-d
import { rectOf, type Texture2D } from '@datamoc/mw_games/two-d/render';declare const texture: Texture2D;const frame = rectOf(texture.frame);console.log(frame); // { x: 0, y: 0, width: 32, height: 32 }, or whatever the texture was cut to Copy
import { rectOf, type Texture2D } from '@datamoc/mw_games/two-d/render';declare const texture: Texture2D;const frame = rectOf(texture.frame);console.log(frame); // { x: 0, y: 0, width: 32, height: 32 }, or whatever the texture was cut to
Converts a
pixi.jsRectangleto the plainRectshape public APIs use. Internal totwo-d; a game never constructs apixi.jsRectangleto call this.