/// <summary>
        /// Create an InterfaceObject using specified width and height
        /// </summary>
        public GameInterfaceObject(GameInterface gameInterface, Texture2D texture, bool initiallyOpen, int width, int height)
        {
            PreConstruct(gameInterface, texture, initiallyOpen);

            _rectangle.Width = width;
            _rectangle.Height = height;

            PostConstruct();
        }
Example #2
0
        /// <summary>
        /// Creates a GameScreen which handles gameplay
        /// </summary>
        public GameScreen(ScreenHandler screenHandler)
            : base(screenHandler)
        {
            // ---------- Create ContentLibrary ----------
            _contentLibrary = new ContentLibrary(Content);

            // ---------- Create GameLevel ----------
            _gameLevel = new GameLevel(this, "poopies");
            //_gameLevel = new GameLevel(this, 40, 40, 1);

            // ---------- Create GameInterface ----------
            _gameInterface = new GameInterface(this);
        }
Example #3
0
        public GI_Label(GameInterface gameInterface, Texture2D texture, GI_WindowCell cell, string text, GI_WindowCellObj obj)
            : base(gameInterface, texture, obj.Width, obj.Height, obj.Left, obj.Top, cell)
        {
            _obj            = obj;
            _textPosition   = Vector2.Zero;
            Text            = text;

            // ---------- Hook up events ----------
            _obj.PositionChanged += delegate()
            {
                AdjustTextPosition();
            };
        }
Example #4
0
 public GI_Button(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, string title)
     : base(gameInterface, texture, width, height, x, y)
 {
     _title = title;
 }
Example #5
0
 public GI_ContentButton(GameInterface gameInterface, int width, int height, int x, int y, CL_ObjType objType)
     : base(gameInterface, objType.Texture, width, height, x, y, objType.Texture.Name)
 {
 }
        /// <summary>
        /// Common constructor code
        /// All constructors should call this method
        /// </summary>
        private void Construct(GameInterface gameInterface, Texture2D texture, int width, int height)
        {
            _gameInterface = gameInterface;
            _texture = texture;

            _rectangle.Width = width;
            _rectangle.Height = height;

            _hovering = false;
            Visible = true;
        }
        /// <summary>
        /// Create a new GI_Obj with specified size and position
        /// </summary>
        public GI_Obj(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y)
        {
            Construct(gameInterface, texture, width, height);

            _rectangle.X = x;
            _rectangle.Y = y;
        }
        /// <summary>
        /// Common constructor code
        /// All constructors should call this function at their beginning
        /// </summary>
        /// <param name="gameInterface">GameInterface containing this object</param>
        /// <param name="texture">This InterfaceObject's draw texture</param>
        private void PreConstruct(GameInterface gameInterface, Texture2D texture, bool initiallyOpen)
        {
            _gameInterface = gameInterface;
            _texture = texture;

            Visible = initiallyOpen;
            if (initiallyOpen)
                _currentFadeFrame = _gameInterface.FadeTotalFrames;
        }
Example #9
0
 /// <summary>
 /// Create a DropdownMenu which spans across the top of the screen
 /// Specify width and height from supplied GameInterface
 /// </summary>
 /// <param name="gameInterface">GameInterface containing this DropdownMenu</param>
 /// <param name="texture">Texture to apply</param>
 public GI_DropdownMenu(GameInterface gameInterface, Texture2D texture, bool initiallyVisible = true)
     : base(gameInterface, texture, gameInterface.Screen.GraphicsDevice.Viewport.Width, gameInterface.DropdownButtonHeight, 0, 0, initiallyVisible)
 {
     Construct();
 }
Example #10
0
        public GI_WindowCellObj(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, GI_WindowCell cell)
            : base(gameInterface, texture, width, height, x, y)
        {
            cell.AddObject(this);
            cell.Window.Closed += Close;

            Closed += delegate()
            {
                // TODO: Add closing event code here
            };
        }
Example #11
0
        private GI_Window _window; // Window containing this cell

        #endregion Fields

        #region Constructors

        public GI_WindowCell(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, GI_Window window)
            : base(gameInterface, texture, width, height, x, y, true)
        {
            _window = window;
            _viewPosition = Vector2.Zero;
            _split = false;

            // ---------- Hook up events ----------
            PositionChanged += delegate()
            {
                if (_split)
                {
                    _childCell1.Position = Position;
                    Vector2 relativePosition = _childCell2.Position - _previousPosition;
                    _childCell2.Position = Position + relativePosition;
                }
            };
        }
Example #12
0
 /// <summary>
 /// Create a new window
 /// </summary>
 /// <param name="gameInterface"></param>
 public GI_Window(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, string title)
     : base(gameInterface, texture, width, height, x, y, false)
 {
     Construct(title);
 }
Example #13
0
        /// <summary>
        /// Create a new text field with a label
        /// </summary>
        public GI_TextField(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, GI_WindowCell cell, string labelText)
            : base(gameInterface, texture, width, height, x, y, cell)
        {
            Construct();

            GI_Label label = new GI_Label(gameInterface, texture, cell, labelText, this);
        }
Example #14
0
 /// <summary>
 /// Create a new text field
 /// </summary>
 public GI_TextField(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, GI_WindowCell cell)
     : base(gameInterface, texture, width, height, x, y, cell)
 {
     Construct();
 }
Example #15
0
 public GI_DropdownSubmenu(GameInterface gameInterface, Texture2D texture)
     : base(gameInterface, texture, gameInterface.DropdownButtonWidth, gameInterface.DropdownButtonHeight, false)
 {
     PositionChanged += delegate()
     {
         for (int i = 0; i < _objs.Count; i++)
         {
             GI_Obj currObj = _objs[i];
             currObj.Position = new Vector2(
                 Left,
                 Top + (i * gameInterface.DropdownButtonHeight));
         }
     };
 }
Example #16
0
 public GI_DropdownButton(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, string title)
     : base(gameInterface, texture, width, height, x, y, title)
 {
 }
        private string _windowTitle; // This window's title

        #endregion Fields

        #region Constructors

        public GameInterfaceWindow(GameInterface gameInterface, Texture2D texture, bool initiallyOpen, string windowTitle)
            : base(gameInterface, texture, initiallyOpen)
        {
            _windowTitle = windowTitle;
        }
Example #18
0
 /// <summary>
 /// Creates a DropdownMenu which spans across the top of the screen
 /// Specify width and height manually
 /// </summary>
 /// <param name="gameInterface">GameInterface containing this DropdownMenu</param>
 /// <param name="texture">Texture to apply</param>
 /// <param name="width">Width of this menu</param>
 /// <param name="height">Height of this menu</param>
 public GI_DropdownMenu(GameInterface gameInterface, Texture2D texture, int width, int height, bool initiallyVisible = true)
     : base(gameInterface, texture, width, height, initiallyVisible)
 {
     Construct();
 }
Example #19
0
 /// <summary>
 /// Create a new GI_Container with specified size and position
 /// </summary>
 public GI_Container(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, bool visible)
     : base(gameInterface, texture, width, height, x, y)
 {
     Construct(visible);
 }
Example #20
0
 /// <summary>
 /// Create a new GI_Obj with specified size
 /// </summary>
 public GI_Obj(GameInterface gameInterface, Texture2D texture, int width, int height)
 {
     Construct(gameInterface, texture, width, height);
 }
 public GI_WindowComponent(GameInterface gameInterface, Texture2D texture, int width, int height, int x, int y, GI_Window window)
     : base(gameInterface, texture, width, height, x, y)
 {
     _window = window;
 }