Пример #1
0
        protected HudControl(string name, HUDEffectType effect)
        {
            this.Name           = name;
            this.effect         = effect;
            this.Visible        = true;
            this.propTimeLiving = 0;
            this.Scaling        = 1.0f;
            this.alpha          = 255;

            this.EffectPulseDuration = 0.5f;
            this.rotation            = 0;
        }
Пример #2
0
        protected HudControl(string name, HUDEffectType effect, string propertyName, object propertyObject, string formatting)
            : this(name, effect)
        {
            // Prepare with reflection
            Type         type         = propertyObject.GetType();
            PropertyInfo propertyInfo = type.GetProperty(propertyName);

            this.getMethodInfo = propertyInfo.GetGetMethod();

            this.propertyObject   = propertyObject;
            this.formattingString = formatting;

            fetchData = true;
        }
Пример #3
0
 public HudSpriteControl(string name, GameTime gameTime, ICanyonShooterGame game, Vector2 size, String texture, Vector2 from, Vector2 to, float timeToLive, Anchor anchor, HUDEffectType effect)
     : base(name, gameTime, from, to, timeToLive, anchor, effect)
 {
     this.Game    = game;
     this.Size    = size;
     this.Texture = game.Content.Load <Texture2D>(texture);
     this.UpdateAnchor();
     Rect = new Rectangle(0, 0, 100, 100);
 }
Пример #4
0
 public HudSpriteControl(string name, GameTime gameTime, ICanyonShooterGame game, Vector2 size, String texture, Vector2 pos, float timeToLive, Anchor anchor, HUDEffectType effect)
     : this(name, gameTime, game, size, texture, pos, pos, timeToLive, anchor, effect)
 {
 }
Пример #5
0
 public HudTextControl(string name, GameTime gameTime, SpriteFont font, Color color, Vector2 pos, float timeToLive, Anchor anchor, HUDEffectType effect, string propertyName, object propertyObject, string formatting)
     : this(name, gameTime, font, color, pos, pos, timeToLive, anchor, effect, propertyName, propertyObject, formatting)
 {
 }
Пример #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">Unique identifier</param>
 /// <param name="gameTime">actual GameTime (containing timegap between last and current frame)</param>
 /// <param name="text">Text to render</param>
 /// <param name="font">SpriteFont-handle</param>
 /// <param name="from">Position to blend from</param>
 /// <param name="to">Position to blend to</param>
 /// <param name="timeToLive">time to display (in seconds), set 0 to render forever</param>
 /// <param name="anchor">Anchor</param>
 public HudTextControl(string name, GameTime gameTime, String text, SpriteFont font, Color color, Vector2 from, Vector2 to, float timeToLive, Anchor anchor, HUDEffectType effect)
     : base(name, gameTime, from, to, timeToLive, anchor, effect)
 {
     this.font = font;
     this.Text = text;
     TextColor = color;
 }
Пример #7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">Unique identifier</param>
 /// <param name="gameTime">actual GameTime (containing timegap between last and current frame)</param>
 /// <param name="text">Text to render</param>
 /// <param name="font">SpriteFont-handle</param>
 /// <param name="pos">Position</param>
 /// <param name="timeToLive">time to display (in seconds), set 0 to render forever</param>
 /// <param name="anchor">Anchor</param>
 public HudTextControl(string name, GameTime gameTime, String text, SpriteFont font, Color color, Vector2 pos, float timeToLive, Anchor anchor, HUDEffectType effect)
     : this(name, gameTime, text, font, color, pos, pos, timeToLive, anchor, effect)
 {
 }
Пример #8
0
 public HudTextControl(string name, GameTime gameTime, SpriteFont font, Color color, Vector2 from, Vector2 to, float timeToLive, Anchor anchor, HUDEffectType effect, string propertyName, object propertyObject, string formatting)
     : base(name, gameTime, from, to, timeToLive, anchor, effect, propertyName, propertyObject, formatting)
 {
     this.font = font;
     TextColor = color;
 }
Пример #9
0
 public HudBarControl(string name, GameTime gameTime, ICanyonShooterGame game, String text, SpriteFont font, String background, Vector2 pos, Vector2 size, float timeToLive, Anchor anchor, HUDEffectType effect)
     : base(name, gameTime, pos, pos, timeToLive, anchor, effect)
 {
     tc    = new HudTextControl(name + "_text", gameTime, text, font, new Color(), pos, timeToLive, anchor, effect);
     sc    = new HudSpriteControl(name + "_sprite", gameTime, game, size, background, pos, timeToLive, anchor, effect);
     Value = 100;
 }
Пример #10
0
 public Hud3DControl(string name, GameTime gameTime, String model, Vector2 from, Vector2 to, float timeToLive, Anchor anchor, HUDEffectType effect)
     : base(name, gameTime, from, to, timeToLive, anchor, effect)
 {
     this.model = model;
 }
Пример #11
0
        protected HudControl(string name, GameTime gameTime, Vector2 from, Vector2 to, float timeToLive, Anchor anchor, HUDEffectType effect)
            : this(name, effect)
        {
            this.CreateTime = gameTime;

            // Scrolling informations
            this.propPos      = from;
            this.PositionFrom = from;
            this.PositionTo   = to;
            this.Scrolling    = (this.PositionTo == PositionFrom) ? false : true;

            // Timing Informations
            this.TimeToLive = timeToLive;

            this.Anchor = anchor;
        }
Пример #12
0
 protected HudControl(string name, GameTime gameTime, Vector2 pos, float timeToLive, Anchor anchor, HUDEffectType effect)
     : this(name, gameTime, pos, pos, timeToLive, anchor, effect)
 {
 }
Пример #13
0
 protected HudControl(string name, GameTime gameTime, Vector2 pos, float timeToLive, Anchor anchor, HUDEffectType effect, string propertyName, object propertyObject, string formatting)
     : this(name, gameTime, pos, pos, timeToLive, anchor, effect, propertyName, propertyObject, formatting)
 {
 }