Author Topic: UI on game object (control panel, monitor)  (Read 3733 times)

S3dition

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
UI on game object (control panel, monitor)
« on: October 09, 2013, 01:50:13 AM »
I've been searching for quite some time on information about applying the UI to a surface instead of binding it to a camera. Does anyone know where there is info about this? Is there a specific name I should be calling it when I do my searches? I need the ability to at least make it appear as if the GUI is on an object.

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI on game object (control panel, monitor)
« Reply #1 on: October 09, 2013, 08:30:25 AM »
Apply UI to a surface? If you have your UI camera render into a texture, you can then draw this texture somewhere in your world by texturing an object.

Sylker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UI on game object (control panel, monitor)
« Reply #2 on: October 10, 2013, 10:58:25 PM »
I tried to apply the render to texture over a plane and everything worked fine but the button's collider appears to be relative to the main camera instead. I can click and or mouse over it in a position that is different from the button's real location in screen.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI on game object (control panel, monitor)
« Reply #3 on: October 11, 2013, 07:53:23 AM »
You won't be able to interact with a rendered texture. The UI created in this manner is for viewing only, not for interaction.

If you want it to be interactable, then you can make a 3D UI and place it anywhere you like in the world. Or just create a game object, put UIPanel, on it, then add child widgets underneath. Position it like you would any other object.

Sylker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UI on game object (control panel, monitor)
« Reply #4 on: October 12, 2013, 11:43:09 PM »
UI Panel over the plane was my first attempt and it worked fine.
I also got it to work using my own Raycast and RaycastHit.textureCoord.
I just want to avoid use Raycast other than NGUI's nor change UICamera's original code.

I think we may have a feature request here , huh?