예제 #1
0
 public void Dispose()
 {
     this.parent = null;
     if (sprite != null)
         sprite.Dispose();
     sprite = null;
     this.text.Dispose();
 }
예제 #2
0
        public SelectorButton(SelectorPannel parent, Types type, Vector2f offset, Vector2f dimensions, string name, Color c, Texture t = null)
        {
            this.parent = parent;
            this.Type = type;
            this.offset = offset;
            this.positionBox = new Rectangle(parent.PositionBox.x + offset.X, parent.PositionBox.y + offset.Y, dimensions.X, dimensions.Y);
            updateBlockParamers();
            this.text = new Text(name, Game1.plainFont);
            text.Color = Color.Black;
            text.CharacterSize = 24;
            text.Origin = new Vector2f(text.GetLocalBounds().Left, text.GetLocalBounds().Top);
            setTextPosition();

            this.outlineLight = new Color(255, 255, 255, 0);
            this.outlineDark = new Color(parent.Color.R, parent.Color.G, parent.Color.B, 220);
            this.currentOutline = outlineDark;
            this.drawColor = c;
            if (t != null)
                sprite = new Sprite(t);
        }
        public override void Dispose()
        {
            this.ChildScreens.Clear();
            this.ChildScreens = null;

            this.contentManager.Dispose();
            this.contentManager = null;

            this.guide = null;

            this.lightLayer.Dispose();
            this.lightLayer = null;

            this.ofd.Dispose();
            this.ofd = null;

            this.pannel.Dispose();
            this.pannel = null;

            this.ParentScreen = null;

            this.pauseMenu.Dispose();
            this.pauseMenu = null;

            this.sfd.Dispose();
            this.sfd = null;

            this.view.Dispose();
            this.view = null;
        }
        public void loadMenus()
        {
            this.pauseMenu = new MenuScreen(this, this.contentManager, "Settings", new Vector2i(0, 0), true, true, false, true, Color.White);
            pauseMenu.Title.Color = Color.Black;
            pauseMenu.addButtons(new string[] { "Continue", "New Level", "Load Level", "Save Level", "Exit" });
            pauseMenu.IsDrawn = false;
            pauseMenu.IsUpdated = false;
            pauseMenu.MouseClick += menu_MouseClick;
            pauseMenu.MouseEnter += menu_MouseEnter;
            pauseMenu.MouseLeave += menu_MouseLeave;
            ChildScreens.Add(pauseMenu);

            this.pannel = new SelectorPannel(this, this.contentManager, this.guide);
            pannel.StateChanged += pannel_StateChanged;
            ChildScreens.Add(pannel);
        }