Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to create sprite over GUI.Drawtexture

Discussion in 'Immediate Mode GUI (IMGUI)' started by Oen44, Jan 29, 2015.

  1. Oen44

    Oen44

    Joined:
    Feb 13, 2014
    Posts:
    24
    Hi,

    How can I make sprites to be over GUI.Drawtexture? I'm using separated prefab that is created when I press button. This prefab is a sprite.

    Here is how it looks like:
    sprite.png
    This blue thing should be over this bronze (GUI.DrawTexture).
     
  2. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
    Hey there,

    OnGUI calls always render last. You will not be able to change the sort order.
     
  3. Oen44

    Oen44

    Joined:
    Feb 13, 2014
    Posts:
    24
    Then any idea how can I do this so it will be like I want?
     
  4. Oen44

    Oen44

    Joined:
    Feb 13, 2014
    Posts:
    24
    If I'll use GUI Texture, will it change anything? I mean I did it but nothing changed but can I do something with it so sprite will be over GUI Texture?

    @Edit
    Solved, just made this Texture as Sprite Renderer and it works.
     
    Last edited: Jan 30, 2015