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

GUI.DrawTexture Problems

Discussion in 'Immediate Mode GUI (IMGUI)' started by Hmmka, Feb 25, 2015.

  1. Hmmka

    Hmmka

    Joined:
    Feb 25, 2015
    Posts:
    1
    Hello!
    I just want to draw a simple image on the screen.

    So my code is:

    void OnGUI()
    {
    GUI.DrawTexture(newRect(0, 0, texture.width / 2.0f, texture.height / 2.0f), texture, ScaleMode.ScaleToFit, true, 0);
    }

    and got this:

    Screen Shot 2015-02-25 at 16.54.54.png

    but the image is:

    Рецепт-1.png

    So how this is possible? Please, help!