playMaker

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

FritsLyn

  • Full Member
  • ***
  • Posts: 191
    • View Profile
No 'Sprite' variable = Not able to change sprites?[SOLVED]
« on: June 17, 2015, 12: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, 01:22:07 AM by jeanfabre »

mdotstrange

  • Hero Member
  • *****
  • Posts: 549
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #1 on: June 17, 2015, 09:15:54 PM »
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: 13611
  • Official Playmaker Support
    • View Profile
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #2 on: June 23, 2015, 04:18:00 AM »
Hi,

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

 Bye,

 Jean

FritsLyn

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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13611
  • Official Playmaker Support
    • View Profile
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #4 on: June 23, 2015, 06: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
    • View Profile
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #5 on: June 23, 2015, 11:23:40 AM »
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: 3317
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: No 'Sprite' variable = Not able to change sprites?
« Reply #6 on: June 23, 2015, 03:22:30 PM »
You can use an Object variable for Sprites.
See attached image....

FritsLyn

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

terri

  • Sr. Member
  • ****
  • Posts: 373
    • View Profile
    • terrivellmann.tumblr.com
Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
« Reply #8 on: June 24, 2015, 07: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: 13611
  • Official Playmaker Support
    • View Profile
Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
« Reply #9 on: June 25, 2015, 04: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: 373
    • View Profile
    • terrivellmann.tumblr.com
Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
« Reply #10 on: June 25, 2015, 06: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!