From 7e848e66facb36b3fc3973094f59baf88b4cb453 Mon Sep 17 00:00:00 2001 From: Robert Kowalski Date: Wed, 21 Feb 2024 16:07:24 -0500 Subject: [PATCH] Add documentation about fixed frame size on plane animation --- src/gameobjects/plane/Plane.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gameobjects/plane/Plane.js b/src/gameobjects/plane/Plane.js index 78dc43d7a..769e6592b 100644 --- a/src/gameobjects/plane/Plane.js +++ b/src/gameobjects/plane/Plane.js @@ -34,7 +34,8 @@ var UUID = require('../../utils/string/UUID'); * atlas or sprite sheet. * * The Plane Game Object also has the Animation component, allowing you to play animations - * across the Plane just as you would with a Sprite. + * across the Plane just as you would with a Sprite. The frame size must be fixed as the + * first frame will be the size of the animation, for example use a `SpriteSheet`. * * Note that the Plane object is WebGL only and does not have a Canvas counterpart. * @@ -241,7 +242,7 @@ var Plane = new Class({ if (resetUV === undefined) { resetUV = true; } var frame = this.frame; - + this.setGridSize(frame.realWidth, frame.realHeight); this.setPerspective(this.width / frame.width, this.height / frame.height); if (this._checkerboard && this._checkerboard !== this.texture)