Scroll large Image

Hi,
I’m a bit of a Unity newbie and am looking for advice on how to show an image when i interact with an object.

I have already created a world with a hotspot that the user can walk up to and plays audio on collide. What i now want to do is when the user presses ‘E’ to interact an image will load onscreen. This image is quite big as it is a multi-page pdf converted to a jpeg so i would need it to appear inside a scrollable pane.

Any advice would be great and much appreciated.

I can provide a link to my 3d world if need be. :slight_smile:

many thanks
Gerry

Hi, welcome to the forum!

You can use “if” statements in the OnGUI function with no problems, so you can flip the value of a boolean variable each time the user presses E:-

var showGUI: boolean;

function OnGUI() {
  if (Input.GetKeyDown("e")) {
    showGUI = !showGUI;
  }

  if (showGUI) {
    // Draw GUI elements.
  }
}

The easiest way to handle the scrolling image is to use a scrollview control with an image inside, rendered with GUI.DrawTexture.

HI,I have the same problem.
Could you detail it?or give some detailed suggestion or code?Thx a lot in advance.