Beispiel #1
0
 public Theme(uint width, uint height)
 {
     ScreenWidth = width;
     ScreenHeight = height;
     PrivateFontCollection pfc = new PrivateFontCollection();
     //String path = Theme.AdaptRelativePathToPlatform("../../../../media/"); 
     //pfc.AddFontFile(path + "arial.ttf");
     //Font f = new Font(pfc.Families[0], 12);
     //defaultTextFont = new TextFontTexture(f); //FontStyle.Bold | FontStyle.Italic));
     defaultTextFont = new TextFontTexture(new Font("Arial", 10, FontStyle.Regular)); //FontStyle.Bold | FontStyle.Italic));
 }
Beispiel #2
0
        /// <summary>
        /// Define una nueva instancia de texto con un número máximo de caracteres igual a maxChars, valor
        /// inicial del texto igual a textoInicial
        /// </summary>
        /// <param Name_="textoInicial"></param>
        /// <param Name_="texFuente"></param>
        public Text(string nombre, TextFontTexture texFuente, int maxChars, string textoInicial)
            : base(nombre)
        {
            if (textoInicial == null)
                throw new ArgumentNullException("textoInicial", "Argumento del constructor de TextInstance(), nulo.");
            if (texFuente == null)
                throw new ArgumentNullException("texFuente", "Argumento del constructor de TextInstance(), nulo.");

            defMaxChars = maxChars;
            _TextValue = textoInicial;
            numVertices = maxChars * 4;

            this.PositionStream_ = new VectorStream<Vector3f>(numVertices);
            this.texCoordStream_ = new VectorStream<Vector2f>(numVertices);
            this.primitiveType_ = OpenTK.Graphics.OpenGL.BeginMode.Quads;
            texFont = texFuente;
            textura = TextureManager.Singleton.CreateTexture2D(texFuente);
            PerformLayout();
        }
        public Texture2D CreateTexture2D(TextFontTexture textFontTex)
        {
            Texture2D tex = new Texture2D("TextFontTexture", textFontTex);

            return(tex);
        }
 public Texture2D(string name, TextFontTexture textFontTex)
     : base(name)
 {
     TextureId_  = textFontTex.TextureID;
     SizeTexture = textFontTex.TextureDim;
 }
Beispiel #5
0
 public Texture2D CreateTexture2D(TextFontTexture textFontTex)
 {
     Texture2D tex = new Texture2D("TextFontTexture", textFontTex);
     return tex;
 }
Beispiel #6
0
 public Texture2D(string name, TextFontTexture textFontTex)
     : base(name)
 {
     TextureId_ = textFontTex.TextureID;
     SizeTexture = textFontTex.TextureDim;
 }
Beispiel #7
0
 /// <summary>
 /// Define una instancia de texto con un número máximo de caracteres igual a maxChars
 /// </summary>
 /// <param Name_="texFuente"></param>
 /// <param Name_="maxChars"></param>
 public Text(string nombre, TextFontTexture pTexFont, int pMaxChars)
     : this(nombre, pTexFont, pMaxChars, "")
 {
 }
Beispiel #8
0
 public Text(string nombre, TextFontTexture pTexFont, String textoInicial)
     : this(nombre, pTexFont, textoInicial.Length, textoInicial)
 {
 }
Beispiel #9
0
 /// <summary>
 /// Define una instancia de texto con un número máximo de caracteres igual a 'DEFAULT_MAX_CHARS'
 /// </summary>
 /// <param Name_="texFuente"></param>
 public Text(string nombre, TextFontTexture pTexFont)
     : this(nombre, pTexFont, DEFAULT_MAX_CHARS, "")
 {
 }