コード例 #1
0
 public void setText(string contents, DFTAlignment alignment)
 {
     text = contents;
     //Ensure inited
     setupTexture();
     //Write text on the texture
     DynamicFontTextureBinding.WriteOnTexture(textureToUse, contents, fontName, alignment, fontSize, width, height);
 }
 public static void WriteOnTexture(Texture textureToWrite, string text, string fontName, DFTAlignment alignment, int fontSize, int width, int height)
 {
     if(width==0||height==0||fontSize==0)
     {
         Debug.Log("Please check arguments.");
     }
     else
     {
         _writeOnGLTexture(textureToWrite.GetNativeTextureID(),text,fontName,(int)alignment,fontSize,width,height);
     }
 }
 public static void WriteOnTexture(Texture textureToWrite, string text, string fontName, DFTAlignment alignment, int fontSize, int width, int height)
 {
     if(width==0||height==0||fontSize==0)
     {
         Debug.Log("Please check arguments.");
     }
     else
     {
         LoadJC();
         string combinedValues=width.ToString()+"_"+height.ToString()+"_"+((int)alignment).ToString()+"_"+fontSize;
         if( jc!=null)jc.CallStatic("textToBitmap",textureToWrite.GetNativeTextureID(),text,fontName,combinedValues);
     }
 }
 public static void WriteOnTexture(Texture textureToWrite, string text, string fontName, DFTAlignment alignment, int fontSize, int width, int height)
 {
     if(width==0||height==0||fontSize==0)
     {
         Debug.Log("DynamicFontTextureBinding.WriteOnTexture: Please check arguments.");
     }
     else
     {
         Debug.Log("DynamicFontTextureBinding.WriteOnTexture: width = " + width + ", height = " + height + ", fontName = " + fontName + ", fontSize = " + fontSize + ", text = " + text);
         _writeOnGLTexture(textureToWrite.GetNativeTextureID(),text,fontName,(int)alignment,fontSize,width,height);
         Debug.Log("DynamicFontTextureBinding.WriteOnTexture Done");
      }
 }
コード例 #5
0
 public void SetString(string contents,DFTAlignment alignment)
 {
     //Ensure inited
     Init();
     //Write text on the texture
     DynamicFontTextureBinding.WriteOnTexture(textureToUse,contents,fontName,alignment,fontSize,width,height);
     //Use the texture for this GameObject's renderer.
     this.transform.renderer.material.SetTexture("_MainTex",textureToUse);
     this.transform.renderer.material.color=new Color(this.transform.renderer.material.color.r,
         this.transform.renderer.material.color.g,
         this.transform.renderer.material.color.b,
         1f);
     currentlyShowing=contents;
 }