Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

I have pictures to show. Use Canvas-image or SpriteRender? Why?

Discussion in '2D' started by atk_defender, Aug 1, 2019.

  1. atk_defender

    atk_defender

    Joined:
    Jun 26, 2018
    Posts:
    20
    Something like RPG's fixed background. They can show by Canvas-image and SpriteRender.
    Something like RPG's health bar. They can show by Canvas-image and SpriteRender, too.
    Both ways can use sorting layer. Both ways can use RectTransform if I need an anchor.
    I'm confused.
     
  2. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    1,088
    Generally, canvas objects are for displaying a GUI; everything else is for gameplay purposes.

    Is your image going to belong to part of a character or the world/level? Use SpriteRenderer.
    Is your image going to provide graphical information to the user? Use Canvas Image.
     
unityunity