Hello Guest

Author Topic: Having trouble understanding SetSprite [C#]  (Read 4036 times)

bartleycollin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Having trouble understanding SetSprite [C#]
« on: April 02, 2014, 06:45:50 pm »
I've been trying to figure this out over the past day, with no luck. I've looked at the forum page, but I think I'm missing something. I would highly appreciate some help with this :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Having trouble understanding SetSprite [C#]
« Reply #1 on: April 02, 2014, 07:47:12 pm »
Have you seen the scripting reference?
http://2dtoolkit.com/docs/latest/html/annotated.html

If you still can't figure it out, what is it you're trying to do?

bartleycollin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Having trouble understanding SetSprite [C#]
« Reply #2 on: April 02, 2014, 08:13:43 pm »
I have seen that, and I'll try again. For now, what I'm trying to do is set up a very simple IF statement that checks if a Bool is true, and if that's the case, switches the object to a specified sprite.

bartleycollin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Having trouble understanding SetSprite [C#]
« Reply #3 on: April 02, 2014, 09:09:46 pm »
I've been trying, I still can't figure it out.

All I'm doing is typing code like this in my update function. I know I'm doing something totally wrong, but I can't figure it out..

Code: [Select]
void Update () {
tk2dBaseSprite.SetSprite(4);
}
}

bartleycollin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Having trouble understanding SetSprite [C#]
« Reply #4 on: April 02, 2014, 09:48:01 pm »
Phew.. I finally got it to work.