playMaker

Author Topic: Update 2d Toolkit Sprite Collection at runtime?  (Read 3696 times)

JennaReanne

  • Junior Playmaker
  • **
  • Posts: 57
    • View Profile
    • Little Worlds Interactive
Update 2d Toolkit Sprite Collection at runtime?
« on: June 13, 2014, 02:32:53 PM »
Hello - I'm using 2d Toolkit with Playmaker, which for the most part works great.  There are actions for setting sprite ID's at runtime, but I can't figure out how to set the sprite collection at runtime.  I've tried using the "Set Property" action, but that didn't seem to work.  Has anybody figured out a way to do this successfully?

Thanks,
Jenna

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3605
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Update 2d Toolkit Sprite Collection at runtime?
« Reply #1 on: June 13, 2014, 09:37:27 PM »
I'm not super familiar with 2d Toolkit, but it sounds like there might be a missing SetSprite action.

You could try using Call Method to call the SetSprite method on a tk2dSpriteCollectionData variable:
http://www.unikronsoftware.com/2dtoolkit/docs/latest/html/classtk2d_base_sprite.html#a2a07db9fdd5df4739ffd956d83f12454

Or maybe someone more familiar with 2d Toolkit can help...?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14119
  • Official Playmaker Support
    • View Profile
Re: Update 2d Toolkit Sprite Collection at runtime?
« Reply #2 on: June 16, 2014, 12:07:33 AM »
Hi,

 Give me a day or two. I'll update the action for you to change the collection as well ( or likely make a new one, cause this is using deprecated api from td2k).

 Bye,

 Jean

spiral

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: Update 2d Toolkit Sprite Collection at runtime?
« Reply #3 on: July 19, 2014, 02:54:24 PM »
bump this!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14119
  • Official Playmaker Support
    • View Profile
Re: Update 2d Toolkit Sprite Collection at runtime?
« Reply #4 on: July 30, 2014, 04:35:36 AM »
Hi,

 That seriously drifted... sorry about the delay. I finally got my head around working this out. I faced lots of trouble on this, but it's available now.

So, not only you can now select a different Collection ( point to the Collection prefab itself), using the sprite name as a string will now work. it was buggy.

I have informed te author, so it's likely going to be features in the next release in the goodies package for PlayMaker.

[EDIT] it's now on the official 2d toolkit package.

 Bye,

 Jean

« Last Edit: August 07, 2014, 02:49:26 AM by jeanfabre »

JennaReanne

  • Junior Playmaker
  • **
  • Posts: 57
    • View Profile
    • Little Worlds Interactive
Re: Update 2d Toolkit Sprite Collection at runtime?
« Reply #5 on: October 15, 2014, 12:53:30 PM »
Hi Jean - First, thanks for putting this together!  Unfortunately I haven't been able to find this action successfully.  I have the most recent version of 2dtoolkit, but I don't see any actions relating to sprite collections, and my "Tk 2d Sprite Set Id" action doesn't have any fields where I could reference a collection.  Would it be possible to post the action (or updated action) directly to this thread so I can grab it?

Thanks,
Jenna

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14119
  • Official Playmaker Support
    • View Profile
Re: Update 2d Toolkit Sprite Collection at runtime?
« Reply #6 on: October 15, 2014, 11:53:15 PM »
Hi,

 Odd. You can find the action just on this thread attached to the post above your last one. then you can reference the collection GamObject directly.

I'll double check with 2dtk author on this.

 Bye,

 Jean