image-object.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. .. include:: ../_header.rst
  2. Image
  3. -----
  4. The `Image <image-object.html>`_ is a built-in Phaser_ object type: `Phaser.GameObjects.Image <https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Image.html>`_.
  5. You can create an `Image`_ object by dropping an Image built-in type or texture from the `Blocks view <blocks-view-integration.html>`_.
  6. .. image:: ../images/scene-editor-drop-image-04152020.webp
  7. :alt: Add image from Blocks view.
  8. The main difference between an `Image`_ and a `Sprite <sprite-object.html>`_ is that the `Image`_ objects cannot play `sprite animations <https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Sprite.html#play__anchor>`_.
  9. An `Image`_ is created in code using the `image factory <https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html#image__anchor>`_. This is how the `scene compiler <scene-compiler.html>`_ generates the code of an `Image`_:
  10. .. code::
  11. const branch_1 = this.add.image(192, 512, "atlas-props", "branch-01");
  12. The `Image`_ has properties common to other object types:
  13. * `Variable properties <variable-properties.html>`_
  14. * `Lists properties <lists-properties.html>`_
  15. * `Transform properties <transform-properties.html>`_
  16. * `Origin properties <origin-properties.html>`_
  17. * `Flip properties <flip-properties.html>`_
  18. * `Visible property <visible-property.html>`_
  19. * `Alpha properties <alpha-properties.html>`_
  20. * `Texture property <texture-property.html>`_