playMaker

Author Topic: How to do simple texture swap 2d [SOLVED]  (Read 2719 times)

krane

  • Junior Playmaker
  • **
  • Posts: 63
How to do simple texture swap 2d [SOLVED]
« on: January 29, 2017, 09:37:57 AM »
I would like to swap a texture of a 2d game object on a button click.
I can't seem to figure this out. can anyone walk me through it?
« Last Edit: February 02, 2017, 10:17:09 AM by krane »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to do simple texture swap 2d
« Reply #1 on: January 29, 2017, 12:45:44 PM »
Hi,
There is a custom action on the Ecosystem called 'Swap sprite' that you can use.

krane

  • Junior Playmaker
  • **
  • Posts: 63
Re: How to do simple texture swap 2d
« Reply #2 on: January 30, 2017, 09:28:51 AM »
thank you!

krane

  • Junior Playmaker
  • **
  • Posts: 63
Re: How to do simple texture swap 2d
« Reply #3 on: February 01, 2017, 09:51:12 AM »
I can't get sprite swap or sprite swap random to work at all.
I've got a uGui button and a canvas image (sprite)
I press the button to send click with ugui/onclick and it doesn't swap the sprite.
can anyone help me out with a quick demo? sorry. I feel like an idiot for not being able to get this working.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to do simple texture swap 2d
« Reply #4 on: February 01, 2017, 02:10:31 PM »
Hi,
You should get "ugui proxy full" package on the Ecosystem.
it has most actions for ugui
after installed, look for "ugui image set sprite"

swap sprite is for 2d

Also a tutorial to use ugui proxy for using buttons and sliders here :


krane

  • Junior Playmaker
  • **
  • Posts: 63
Re: How to do simple texture swap 2d
« Reply #5 on: February 02, 2017, 08:36:44 AM »
Yes, i already have the ugui proxy and i'm using the sprite swap because it's for 2d. I want 2d. Thank you.

The problem is I can't get it to work.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to do simple texture swap 2d
« Reply #6 on: February 02, 2017, 10:05:29 AM »
Hi,
If you want to change sprite from the ugui you need to use "ugui image set sprite"

"sprite swap" and "sprite swap random" only work on 2d GameObjects

krane

  • Junior Playmaker
  • **
  • Posts: 63
Re: How to do simple texture swap 2d
« Reply #7 on: February 02, 2017, 10:16:55 AM »
Ah crap. No wonder. Thanks!