Exemplo n.º 1
0
        public Window(int x, int y, int w, int h)
        {
            _bounding = new Rectangle(x, y, w, h);
            _layerDepth = 1;
            _contentsPosition = Point.Zero;
            _color = Color.White;
            _opacity = 255;
            _backOpacity = 255;
            _contentsOpacity = 255;
            _openness = 1;
            IsOpening = true;
            _padding = 12;
            _active = true;
            _visible = true;
            Windowskin = Game1.Instance.Content.Load<Texture2D>("Windowskin");
            _skin = new MenuSkin();

            _frame = new Sprite(false);
            _frame.LayerDepth = 0;
            _frame.Set(x, y);
            _contents = new Sprite(false);
            _contents.ResizeSource(w - _padding * 2, h - _padding * 2);
            _contents.Set(x+_padding, y+_padding);
            

            DrawFrame();
            DrawContents();

            Graphics.Windows.Add(this);

            
        }
Exemplo n.º 2
0
 public virtual void Dispose()
 {
     Windowskin = null;
     _skin = null;
     _frame.Dispose();
     _contents.Dispose();
     Graphics.Windows.Remove(this);
     Disposed = true;
 }