Custom score texture

I was just wondering if anyone has used a texture to display the score. What I want is to design my own numbers 0 - 9 and use this texture as the font display instead of a GUI font. Has anyone used this technique before. It's just a rough idea I was just wondering if there were any examples out there?


To design textures fonts:

  1. Design 0 - 9 like you mentioned

  2. An array of Texture2D and them in, index 0 for 0 and so on till 9

  3. For the score you're setting, store it as a numeral as per normal

  4. When you want to display the score, convert it to string and parse each character as an integer and use the parsed integers as indexes for your textures.

    public Texture2D[] myArray; // slot in your textures on the editor.

    int myScore = 10000; // Put any number int textureDimension = 50;

    void OnGUI(){

       string myStringScore = myScore.ToString();
      for (int i =0 ; i < myStringScore.Length ; i++)
            GUI.drawTexture(new Rect(i * textureDimension , 0, textureDimension ,textureDimension  ) ,   myArray[int.Parse(myStringScore *) ] );*

Can you convert that to JS?