Hello Guest

Author Topic: 2d toolkit and new unity ui system  (Read 8080 times)

nikolayku

  • Newbie
  • *
  • Posts: 3
    • View Profile
2d toolkit and new unity ui system
« on: August 25, 2017, 02:55:44 pm »
HI to all. My unity version 2017.1.0f3 and 2d toolkit 2.5.3
How can I use 2d toolkit with new unity ui system (uui)

For example how can I convert UITk2dSprite to Image.sprite
Or can I insert mapObjectIcon.sprite directly into canvas game object ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2d toolkit and new unity ui system
« Reply #1 on: August 30, 2017, 05:43:44 pm »
Hi,

2d toolkit isn't compatible with the new UI system out of the box. I am happy to add support for tk2d sprites in the new unity ui, but there really hasn't been too much interest in this. If there is enough interest I will add it and officially support, but to do it "properly" and maintain it is a significant amount of work.

I do remember someone posting a solution on github that worked in a lot of cases somewhere, but I don't seem to be able to find it... If you can't find it and really need this, let me know - I can make a simple adapter that works in lot of common cases (not all) really easily.

nikolayku

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: 2d toolkit and new unity ui system
« Reply #2 on: September 07, 2017, 08:42:32 am »
Thank you for answer.
I use search on this forum and can't find solution what you talking about. Can you provide me link to it or write adapter.
Thank you .

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2d toolkit and new unity ui system
« Reply #3 on: September 10, 2017, 11:07:33 pm »
I will try and write something this week - I can't find the link I was referring to either.

nikolayku

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: 2d toolkit and new unity ui system
« Reply #4 on: September 15, 2017, 11:24:30 am »
Ok, please notify in this tread when it will ready. Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2d toolkit and new unity ui system
« Reply #5 on: September 17, 2017, 11:43:40 am »
Here's a simple implementation of it -
1. Import the unity package (Unity 5.4 minimum)
2. drag the tk2dUnityUI to a Unity UI rect transform (make sure there is no image script on it)
3. drag the sprite collection data object into the slot and select the id.

The inspector isn't pretty - if this works for what you're trying to do I'll try and get a better looking inspector UI in the next week. It supports most tk2d features including dicing.

If its stable enough, maybe this could go into tk2d as well.
« Last Edit: September 17, 2017, 11:46:19 am by unikronsoftware »

kerimfake

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: 2d toolkit and new unity ui system
« Reply #6 on: March 12, 2018, 10:13:58 am »
Hi there, it seems you've attached a file to your post, but I can't find it. Can you please help me out about this? Or re-attach it if possible?