playMaker

Author Topic: ex2D Set Sprite action  (Read 3251 times)

Jos Yule

  • Playmaker Newbie
  • *
  • Posts: 33
    • View Profile
ex2D Set Sprite action
« on: May 30, 2012, 11:50:00 AM »
hello all.

I've created an ex2D Set Sprite action. You can use it to, well, set the sprite "image" of an exSprite.

There are 3 parameters:

1. The Game Object with the exSprite component
2. The name of the sprite which you wish to display
3. The name of the atlas which contains that sprite

That is it. Let me know of any problems or questions via this topic!

Thanks
Jos

ps. I've included the actual .cs file - you just need to drop it into your project somewhere. PlayMaker should then be able to pick it up and show it in the action list.

Jos Yule

  • Playmaker Newbie
  • *
  • Posts: 33
    • View Profile
Re: ex2D Set Sprite action
« Reply #1 on: May 31, 2012, 09:14:53 AM »
Dang. I somehow missed the .atlas property on all exSprite instances. This can clean up the use of the Resources.Load() method i'm currently using to get an Atlas. However, you would then be limited to only changing the sprite to another in the current sprite atlas.

I'm not sure if i'm going to change how it works or not. I need to get some more use out of it to see if this is an issue or not.

I suppose i could also create a new action which would change the atlas the sprite used, or, using the current action, check to see if you include a name in the 'Atlas Name' property. If not, it uses the one in the .atlas property.

That might be the best bet, actually.