playMaker

Author Topic: No 'Sprite' variable = Not able to change sprites?[SOLVED]  (Read 5845 times)

FritsLyn

  • Full Member
  • ***
  • Posts: 191
No 'Sprite' variable = Not able to change sprites?[SOLVED]
« on: June 17, 2015, 03:24:49 PM »
Hi,

If I want to have a series of images in a hash table, and via Playmaker change Sprites in uGUI, it appears there's a missing bridge in the current Playmaker functionality?

I can make workaraounds (not use sprites etc) and there's the almost obsolete FSM in the Ecosystem: 'U Gui Image Set Sprite' (obsolete because it's just as easy to just drag in the Sprite component into Playmaker and set it that way).

But it appears to me that since there's no 'Sprite' variable, then

A) Sprites cannot be stored in arrays (only Textures)
B) Sprites cannot be set in FSM's as variables (only by pointing at files directly)

This appears kind of like a missing bridge to me? Or am I missing something?

PS: It could be fixed by allowing 'GameObject' variable type to be used, I'd suppose?

:)

Thanks!
« Last Edit: June 24, 2015, 04:22:07 AM by jeanfabre »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #1 on: June 18, 2015, 12:15:54 AM »
I was trying to do the same thing- using hash tables with sprites for an inventory system and couldn't get it working- ended up using texture variables with "raw image" in the ui instead-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #2 on: June 23, 2015, 07:18:00 AM »
Hi,

 Currently underWay, I'll push ArrayMaker update soon and it will feature sprites.

 Bye,

 Jean

FritsLyn

  • Full Member
  • ***
  • Posts: 191
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #3 on: June 23, 2015, 07:20:41 AM »
You rock Jean! :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #4 on: June 23, 2015, 09:50:56 AM »
Hi,

 Can you get the latest on the Ecosystem,

It now features Sprites support. Let me know if all goes ok.


Bye,

 Jean

FritsLyn

  • Full Member
  • ***
  • Posts: 191
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #5 on: June 23, 2015, 02:23:40 PM »
I went into the Ecosystem

I searched for 'ArrayMaker'

I deleted it (red button)

I 'installed' it again.

Check - now, when I add a component, PlayMaker Hash Proxy, in the Prefill Type dropdown I can now chose a new type: Sprite.

But..

When I want to transport such a variable, even by 'raw Set Property' - I do not see how I can, since PlayMaker is not (as far as I can tell) supporting this variable type (Sprite).

So, it appears to me that now the source is there, but there's no way to handle it?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #6 on: June 23, 2015, 06:22:30 PM »
You can use an Object variable for Sprites.
See attached image....

FritsLyn

  • Full Member
  • ***
  • Posts: 191
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #7 on: June 24, 2015, 02:55:10 AM »
Oh! Thanks!

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
« Reply #8 on: June 24, 2015, 10:29:37 AM »
trying the same thing, how does this work exactly?

because both with the U GUI Image Set Sprite from the ecosystem and with Set Property on the sprite component, it doesn't seem to be possible to set it as using an object variable?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
« Reply #9 on: June 25, 2015, 07:28:48 AM »
Hi

Your object type for your variable must be UnityEngine.Sprite. else it's not a sprite.

Bye,

 Jean

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
« Reply #10 on: June 25, 2015, 09:20:17 AM »
I was having trouble because I missed the part where this is something I can change in the object variable.

That made it work, thanks!