Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: JennaReanne on June 13, 2014, 05:32:53 PM

Title: Update 2d Toolkit Sprite Collection at runtime?
Post by: JennaReanne on June 13, 2014, 05: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
Title: Re: Update 2d Toolkit Sprite Collection at runtime?
Post by: Alex Chouls on June 14, 2014, 12:37:27 AM
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...?
Title: Re: Update 2d Toolkit Sprite Collection at runtime?
Post by: jeanfabre on June 16, 2014, 03: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
Title: Re: Update 2d Toolkit Sprite Collection at runtime?
Post by: spiral on July 19, 2014, 05:54:24 PM
bump this!
Title: Re: Update 2d Toolkit Sprite Collection at runtime?
Post by: jeanfabre on July 30, 2014, 07: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

Title: Re: Update 2d Toolkit Sprite Collection at runtime?
Post by: JennaReanne on October 15, 2014, 03: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
Title: Re: Update 2d Toolkit Sprite Collection at runtime?
Post by: jeanfabre on October 16, 2014, 02:53:15 AM
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