コード例 #1
0
        //public static MenuScreen Instance
        //{
        //    get
        //    {
        //        //if (instance == null)
        //        //{
        //        //    instance = new MenuScreen();
        //        //}
        //        return instance;
        //    }
        //    set
        //    {
        //        instance = value;
        //    }
        //}
        //


        public override void LoadContent()
        {
            base.LoadContent();
            this.logo = new Image("logo");
            this.logo.LoadContent();

            this._btnPlay = new Button(this.Content.Load<Texture2D>("Buttons/play"));
            this._btnPlay.Size = new Vector2(200,100);
            this._btnPlay.setPosition(new Vector2(1166, 170));
            this._btnPlay.ConstFlash = true;

            this._controls = new Button(this.Content.Load<Texture2D>("Buttons/controls"));
            this._controls.setPosition(new Vector2(0, 150));
            this._controls.Size = new Vector2(200, 100);

            this.destroyer = new Button(this.Content.Load<Texture2D>("ShipsContents/destroyerLeft"));
            this.destroyer.setPosition(new Vector2(100, 400));
            this.destroyer.Size = new Vector2(137, 150);

            this.battleship = new Button(this.Content.Load<Texture2D>("ShipsContents/battleshipLeft"));
            this.battleship.setPosition(new Vector2(600, 550));
            this.battleship.Size = new Vector2(137, 150);

            this.cruiser = new Button(this.Content.Load<Texture2D>("ShipsContents/cruiserLeft"));
            this.cruiser.setPosition(new Vector2(1100, 400));
            this.cruiser.Size = new Vector2(137, 150);

        }
コード例 #2
0
 public ControlScreen()
 {
     this.Content = ScreenManager.Instance.Content;
     this.back = new Button(this.Content.Load<Texture2D>("Buttons/back"));
     this.back.setPosition(new Vector2(50, 50));
     this.back.Size = new Vector2(75, 75);
 }
コード例 #3
0
 public sealed override void LoadContent()
 {
     base.LoadContent();
     this.playAgain = new Button(this.Content.Load<Texture2D>("Buttons/exit"));
     this.playAgain.Position = new Vector2(ScreenManager.Instance.Dimensions.X / 2 - this.playAgain.Size.X/2f,ScreenManager.Instance.Dimensions.Y / 2);
     this.playAgain.Size = new Vector2(200,100);
     this.playAgain.ConstFlash = true;
     FirstPlayer.Instance.LoadContent();
     SecondPlayer.Instance.LoadContent();
     this.background.LoadContent();
     FontsManager.LoadContent();
     Item.LoadContent();
 }