示例#1
0
        // BASE OVERRIDES
        public override void InitializeState()
        {
            Vector2f vecViewCenter = new Vector2f((Engine.Instance.GameWindow.Size.X) / 2, (Engine.Instance.GameWindow.Size.Y) / 2);

            View = new SFML.Graphics.View(vecViewCenter, (Vector2f)Engine.Instance.GameWindow.Size);
            Engine.Instance.GameWindow.SetView(View);

            this.UI            = UI_MainMenu.CreateMainMenuInterface(ref Engine.Instance, this);
            this.IsStateActive = true;
            this.IsStateAlive  = true;
            this.StateName     = nameof(MainMenuState);
            FileStream fsImageStream = new FileStream(@"Assets\Backgrounds\MMBG01.png", FileMode.Open);

            BGTexture = new Texture(fsImageStream);
            BGSprite  = new Sprite(BGTexture);
        }
示例#2
0
 /// <summary>
 /// Prende riferimento ai menu
 /// </summary>
 protected override void OnSetup()
 {
     mainMenuPanel = GetComponentInChildren <UI_MainMenu>();
     gameplayPanel = GetComponentInChildren <UI_GameplayPanel>();
 }