Author Topic: buttons inside Scroll View (Camera) unclickable  (Read 3971 times)

eedok

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
buttons inside Scroll View (Camera) unclickable
« on: May 30, 2012, 03:47:48 PM »
Trying to recreate the scroll view (camera) example, but when I tried it, the buttons inside the scroll view don't seem to be getting click events, here's the steps that I did:

1. Created 2 UI's Main and view
2. In View's UI I separated the anchor and the camera and set the camera in the anchor to Main's camera
3. Positioned the View Panel and camera way off screen
4. Put UIGrid on the View Panel, added a bunch of buttons and hit reposition
5. Created a sliced sprite background for the area in Main's panel, and gave it 2 child objects topleft at the top left and bottomright at the bottom right
6. Attached UIViewPort and UIDraggableCamera to View's Camera, in UIViewPort setting Source Camera to Mains Camera, and the top left and bottom right points to the empty objects from the previous step. Set the root in UIDraggableCamera to View's root
7. On the sliced sprite created in step 5, I added a collider and UIDragCamera script to it. Setting the draggable camera to View's camera

From here I can drag around the contents of the view but can't interact with any of the buttons, did I miss a step or is there a gotcha somewhere?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: buttons inside Scroll View (Camera) unclickable
« Reply #1 on: May 30, 2012, 04:01:02 PM »
Did you forget a UICamera? Two things are needed to receive events -- UICamera to send them (one per camera you have), and a collider on the layer that's covered by the event mask on the UICamera to receive them.

eedok

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: buttons inside Scroll View (Camera) unclickable
« Reply #2 on: May 30, 2012, 04:04:14 PM »
ah the event mask on the view camera was set to the wrong layer, thanks