예제 #1
0
        protected override void Initialize()
        {
            base.Initialize();
            this.spriteBatch  = new SpriteBatch(this.GraphicsDevice);
            this.Window.Title = "Paladin Rescue Team";

            Resolution resolution = Utilities.GetSupportedResolutions().Last();


            // Init call mandated by Auxiliary library.
            Root.Init(this, this.spriteBatch, this.graphics, resolution);
            Root.BeforeLastDraw = () =>
            {
                UX.Clear();
                Tooltip.Clear();
            };
            Writer.SpriteBatch = this.spriteBatch;


            if (this.ImmediatelyFullscreenize)
            {
                Root.SetResolution(Utilities.GetSupportedResolutions().FindLast(m => true));
                Root.IsFullscreen = true;
            }


            Assets.LoadAll(Content);
            SFX.Load(Content);



            Primitives.Fonts.Add(FontFamily.Small,
                                 new FontGroup(Assets.FontLittle, Assets.FontLittleItalic, Assets.FontLittleBold,
                                               Assets.FontLittleBoldItalic));
            Primitives.Fonts.Add(FontFamily.Normal,
                                 new FontGroup(Assets.FontNormal, Assets.FontNormal, Assets.FontNormalBold, Assets.FontNormalBold));
            Primitives.Fonts.Add(FontFamily.Big,
                                 new FontGroup(Assets.FontBig, Assets.FontBig, Assets.FontBigBold, Assets.FontBigBold));


            // Make the buttons orange.
            GuiSkin mainSkin = GuiSkin.DefaultSkin;

            mainSkin.Font = Assets.FontNormal;
            mainSkin.InnerBorderThickness         = 1;
            mainSkin.OuterBorderThickness         = 1;
            mainSkin.GreyBackgroundColor          = Color.DarkOrange;
            mainSkin.GreyBackgroundColorMouseOver = Color.Orange;
            mainSkin.InnerBorderColor             = Color.Red;
            mainSkin.InnerBorderColorMouseOver    = Color.Red;
            mainSkin.InnerBorderColorMousePressed = Color.DarkRed;

            Root.Display_DisplayFpsCounter      = false;
            Root.Display_DisplayFpsCounterWhere = new Vector2(5, 55);
            // Go to main menu.
            Root.PushPhase(new MainMenuPhase());
        }
예제 #2
0
 protected override void Draw(GameTime gameTime)
 {
     // Auxiliary handles all drawing.
     this.GraphicsDevice.Clear(Color.CornflowerBlue);
     Tooltip.Clear();
     UX.Clear();
     this.spriteBatch.Begin();
     Root.DrawPhase(gameTime);
     Tooltip.DrawTooltipReally();
     Root.DrawOverlay(gameTime);
     this.spriteBatch.End();
     base.Draw(gameTime);
 }