Ejemplo n.º 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));
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
 public Text(string nombre, TextFontTexture pTexFont, String textoInicial)
     : this(nombre, pTexFont, textoInicial.Length, textoInicial)
 {
 }
Ejemplo n.º 4
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, "")
 {
 }
Ejemplo n.º 5
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, "")
 {
 }