Hello Guest

Author Topic: How to implement rotating puzzle pieces (a noob's odyssey)  (Read 13223 times)

Mezcaholic

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: How to implement rotating puzzle pieces (a noob's odyssey)
« Reply #15 on: January 27, 2013, 03:29:41 am »
Is there an easy way to setup the tk2dCamera so that the origin is at the top left and positive Y is down?

-E

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to implement rotating puzzle pieces (a noob's odyssey)
« Reply #16 on: January 27, 2013, 09:29:16 am »
No there isn't.
Its quite a bit trickier than it sounds -
Its easy to modify the camera so it does that. However, that means that the y axis is flipped, and all sprites will be flipped vertically. To fix it, all sprites will need to be flipped vertically internally to compensate, but this means that the sprites won't be compatible with normal cameras any more.

Mezcaholic

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: How to implement rotating puzzle pieces (a noob's odyssey)
« Reply #17 on: January 28, 2013, 03:53:44 pm »
Yeah, I found out the hard way.  :)  But I learned a bit more in the process.  I was able to modify my code to work with the given coordinate system.  It was really only and issue where I try to layout tiles from an array of data.  Everywhere else it's very natural to use that system.

Thanks,
-E

Mezcaholic

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: How to implement rotating puzzle pieces (a noob's odyssey)
« Reply #18 on: January 29, 2013, 04:14:11 pm »
Ok I have my 2d 3D carousel and now I need to animate it.  The real intended audience for this is touch enabled devices.  They should be able to touch any where along the control and swipe left or right to spin it or depress the front facing sprite to select it.

Thing is I don't really know how to approach this.  I can put an invisible button on the front facing symbol but how do I get continuous live control for the spinning part?  I'll post to unity forum as well as I know this is not really a 2dtoolkit issue but any insights from the 2dtoolkit user base would be greatly appreciated.

Thanks,
-E

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to implement rotating puzzle pieces (a noob's odyssey)
« Reply #19 on: January 29, 2013, 08:10:17 pm »
What do you mean by the "continuous live control"? Isn't this whole thing just a big illusion - you scale and offset your sprites based on how its spinning, so the control itself still remains static?


Mezcaholic

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: How to implement rotating puzzle pieces (a noob's odyssey)
« Reply #20 on: January 29, 2013, 11:58:39 pm »
Yes, it is an illusion.  Though the buttons don't track mouse movement, they only have up down events so I am not sure how I would go about getting those values.  Is there a way for me to track down the movement of the mouse or fingers in a specific region?

Everything else I have working fine with the buttons but the don't need to feed movement to the control, they just need to know they have been pressed.  I apologize if this is a very basic question but I'm not sure how to do that.  I'm still digging around trying to find what I need.

Thanks,
-E

Mezcaholic

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: How to implement rotating puzzle pieces (a noob's odyssey)
« Reply #21 on: January 30, 2013, 03:36:36 am »
Ok, it looks like Input.GetAxes is what I am looking for.  I'll report back with what I find.

-E