Exemplo n.º 1
0
        public void constructor(float X, float Y, float Width, float Height, string sText, Color cColor, SpriteFont fFont, float fScale, FlxJustification fJustification, float fAngle)
        {
            _text  = sText;
            color  = cColor;
            shadow = Color.Black;

            backColor = new Color(0xFF, 0xFF, 0xFF, 0x0);
            if (fFont == null)
            {
                fFont = FlxG.Font;
            }
            _font  = fFont;
            angle  = fAngle;
            _scale = fScale;

            alignment = fJustification;

            x      = X;
            y      = Y;
            width  = Width;
            height = Height;

            scrollFactor = Vector2.Zero;

            solid = false;
            moves = false;
            recalcMeasurements();
        }
Exemplo n.º 2
0
 /**
  * You can use this if you have a lot of text parameters
  * to set instead of the individual properties.
  *
  * @param	Font		The name of the font face for the text display.
  * @param	Scale		The scale of the font (in AS3 flixel, this is Size)
  * @param	Color		The color of the text in traditional flash 0xRRGGBB format.
  * @param	Alignment	A string representing the desired alignment ("left,"right" or "center").
  * @param	ShadowColor	A uint representing the desired text shadow color in flash 0xRRGGBB format.
  *
  * @return	This FlxText instance (nice for chaining stuff together, if you're into that).
  */
 public FlxText setFormat(SpriteFont Font, float Scale, Color Color, FlxJustification Alignment, Color ShadowColor)
 {
     if (Font == null)
     {
         Font = FlxG.Font;
     }
     _font     = Font;
     _scale    = Scale;
     color     = Color;
     alignment = Alignment;
     shadow    = ShadowColor;
     recalcMeasurements();
     return(this);
 }
Exemplo n.º 3
0
 /**
  * You can use this if you have a lot of text parameters
  * to set instead of the individual properties.
  *
  * @param	Font		The name of the font face for the text display.
  * @param	Scale		The scale of the font (in AS3 flixel, this is Size)
  * @param	Color		The color of the text in traditional flash 0xRRGGBB format.
  * @param	Alignment	A string representing the desired alignment ("left,"right" or "center").
  * @param	ShadowColor	A uint representing the desired text shadow color in flash 0xRRGGBB format.
  *
  * @return	This FlxText instance (nice for chaining stuff together, if you're into that).
  */
 public FlxText setFormat(SpriteFont Font, float Scale, Color Color, FlxJustification Alignment, Color ShadowColor)
 {
     if(Font == null)
         Font = FlxG.Font;
     _font = Font;
     _scale = Scale;
     color = Color;
     alignment = Alignment;
     shadow = ShadowColor;
     recalcMeasurements();
     return this;
 }
Exemplo n.º 4
0
        public void constructor(float X, float Y, float Width, float Height, string sText, Color cColor, SpriteFont fFont, float fScale, FlxJustification fJustification, float fAngle)
        {
            _text = sText;
            color = cColor;
            shadow = Color.Black;

            backColor = new Color(0xFF, 0xFF, 0xFF, 0x0);
            if (fFont == null)
                fFont = FlxG.Font;
            _font = fFont;
            angle = fAngle;
            _scale = fScale;

            alignment = fJustification;

            x = X;
            y = Y;
            width = Width;
            height = Height;

            scrollFactor = Vector2.Zero;

            solid = false;
            moves = false;
            recalcMeasurements();
        }
Exemplo n.º 5
0
 public FlxText setFormat(string Font, float Scale, Color Color, Color ShadowColor, FlxJustification Alignment)
 {
     return(setFormat(FlxG.Content.Load <SpriteFont>(Font), Scale, Color, Alignment, ShadowColor));
 }
Exemplo n.º 6
0
        public FlxText(float X, float Y, float Width, float Height, string Text, Color cColor, SpriteFont fFont, float fScale, FlxJustification fJustification, float fAngle)
            : base(X, Y)
        {
            if (Text == null)
            {
                Text = "";
            }

            constructor(X, Y, Width, Height, Text, Color.White, FlxG.Font, 1, FlxJustification.Center, fAngle);
        }