2D Toolkit Forum

2D Toolkit => Support => Topic started by: bartleycollin on April 02, 2014, 06:45:50 pm

Title: Having trouble understanding SetSprite [C#]
Post by: bartleycollin 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 :)
Title: Re: Having trouble understanding SetSprite [C#]
Post by: unikronsoftware 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?
Title: Re: Having trouble understanding SetSprite [C#]
Post by: bartleycollin 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.
Title: Re: Having trouble understanding SetSprite [C#]
Post by: bartleycollin 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);
}
}
Title: Re: Having trouble understanding SetSprite [C#]
Post by: bartleycollin on April 02, 2014, 09:48:01 pm
Phew.. I finally got it to work.