3
« on: March 25, 2013, 04:16:11 am »
First off, I've read the top thread in the FAQ about "How do I access 2D Toolkit from JavaScript" I followed the instructions for the latest version and clicked "Set Up For JavaScript" and I can honestly say I have no idea what it did...
My situation is that I have a game I've been working on that's completely in JavaScript. I'd like to use the 2DToolKit for text. I've read through all of the tutorials and they were extremely helpful, but since I'm pretty much a beginner at this, I still have many questions...
1-Is it possible to do 2DToolKit scripting in JavaScript, or do I have to make C# scripts and then try to access those scripts from my other JavaScripts?
2-Whichever way it is that I have to work, how do I do it? Are there any examples anywhere of this stuff?
For example, I have a HeroController JavaScript and it increments a coinCount variable in it when the hero collides with coins. I want to display the coinCount variable using 2dToolKit. For the life of me, I can't get this to work at all. I can display the coinCount using OnGui in another JavaScript by making it a static variable and accessing it using HeroController.coinCount. I've also gone through the TextMesh scripting tutorial and I can get the score to update when I press the Q button. However, I have NO IDEA how to go about getting my existing Hero script to work with the 2DToolKit.
I'm sorry if this is simple to most of you, but I'm fairly inexperienced with a lot of this and I finally decided to break down and ask. I can post my HeroController JavaScript and the TextMesh scripting tutorial script if that helps.
Thanks so much!