Esempio n. 1
0
        public PowerupGUI(HeadsUpDisplay hud, int type, double time, uint graphicsMode)
        {
            HUD  = hud;
            Type = type;

            Shape       = PowerupPickup.GetModel(type, graphicsMode, 160, 180);
            Shape.Scale = new Vector2f(1.5f, 1.5f);
            AddChild(Shape);

            Time       = new Text("0.0", Game.TidyHand, 24);
            Time.Color = new Color(15, 15, 15, 220);
            FloatRect textRect = Time.GetLocalBounds();

            Time.Origin = new Vector2f(textRect.Left + (textRect.Width / 2.0f), textRect.Top + (textRect.Height / 2.0f));
            AddChild(Time);

            UpdateTimer          = new Timer(100);
            UpdateTimer.Elapsed += OnUpdate;

            Update(time);
            UpdateTimer.Start();
        }
Esempio n. 2
0
 public PowerupPickup(Game game, int type) : base(game, null)
 {
     Type  = type;
     Model = PowerupPickup.GetModel(type, Game.GraphicsMode);
     AddChild(Model);
 }