Hello Guest

Author Topic: 2 cameras and depth  (Read 4170 times)

larryapple

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
2 cameras and depth
« on: June 23, 2013, 12:02:15 am »
I am having flaky results using a main camera with cards and a table in perspective mode, and tk2dUI with an ortho camera size 1 for UI only. I am using the 2 UI panels you provided as my starting point. I am using EasyTouch to recognize single clicks on the cards and table. I am also trying to carefully follow the placement of cards and UI elements in the z plane. Both cameras have a z of -10. The table is at .1, and the panels start at 0 and the objects within -.01, etc. as provided. I am placing the cards starting at 0 and going negative a small amount if the card is to overlap another card and be on top.

But the latest odd result is that the card I place (face down) to represent the deck recognizes a click on it to deal the hand, but if I call up the panel and then immediately dismiss it, it no longer responds to a touch. But any other cards already on the table respond ok. Could it be an issue with EasyTouch? I am at a loss on where to look next.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2 cameras and depth
« Reply #1 on: June 23, 2013, 12:46:19 am »
I have no ideas as to what could be going wrong. There are so many variables at play here, and any one of them could be the cause. My recommendation is to isolate systems, and then add some debugging code to try and work out why your touch stops working.

larryapple

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: 2 cameras and depth
« Reply #2 on: June 23, 2013, 02:30:34 am »
Thanks for prompting me to stop and think. I just started deactivating things in the scene until it saw the deck card again. Turns out that when I dismissed the panel, I didn't put it quite as far off the screen as originally. (I was experimenting with camera field of view to make the cards as large as possible for each aspect ratio, by placing the deck further to the left on 16 x 9, and the numbers kept changing). For some reason, even though the panel wasn't visible, it was obscuring the deck, which is the furthest object to the left. All fixed now!