Hello Guest

Author Topic: Need help with Tk2dButton + NGUI  (Read 4587 times)

itjunkii

  • Newbie
  • *
  • Posts: 7
    • View Profile
Need help with Tk2dButton + NGUI
« on: May 15, 2013, 05:42:10 am »
Hello,

First off thanks for making a great product. I am very happy with it so far!

I am having a bit of a problem.

I am NGUI to create a 2D Ortho camera to control my gui w/ anchor points and such. Also, I am using 2dtk in Javascript mode.

In certain ngui anchor points I have tk2dsprites + tk2dbuttons

The issue is when I instantiate NGUI prefab dynamically in my level scenes it's hit or miss with the tk2d buttons - sometimes they work sometimes they don't.

When I just don't dynamically instantiate and just drop the prefab in a scene and press play all tk2d buttons work perfectly.

I am puzzled, any idea why this would happen? It's hit or miss as I said, sometimes certain buttons work sometimes they don't.

Any idea on how I can troubleshoot? I get nothing from the console indicating an error.

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Need help with Tk2dButton + NGUI
« Reply #1 on: May 15, 2013, 10:00:49 am »
If they don't work it could be because the collider is intersecting with the camera... Select both the camera & the button to see whats happening there.

itjunkii

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Need help with Tk2dButton + NGUI
« Reply #2 on: May 16, 2013, 09:21:22 am »
Highly EPIC suggestion just like the plugin  8)

Switched to manually setting the transform.position and transorm.rotation and we are good to go.

Thank you!!!