shape-rectangle-object.rst 916 B

123456789101112131415161718192021
  1. .. include:: ../_header.rst
  2. Rectangle
  3. =========
  4. You can create a `Rectangle <https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Rectangle.html>`_ by dropping the **Rectangle** block, from the |BlocksView|_, on the scene.
  5. .. image:: ../images/scene-editor-rectangle-1-11092020.webp
  6. :alt: Create a rectangle.
  7. You can change the size of the Rectangle in the **Size section** or you can use the `Size tool <manipulation-tools.html#resize-tool>`_.
  8. .. image:: ../images/scene-editor-rectangle-2-11092020.webp
  9. :alt: Change the rectangle size.
  10. The `Rectangle <https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Rectangle.html>`_ code is generated by the |SceneCompiler|_ using the `rectangle object factory <https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html#rectangle__anchor>`_:
  11. .. code::
  12. const rectangle = this.add.rectangle(10, 10, 100, 100);