コード例 #1
0
        /// <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();
        }
コード例 #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);
        }
コード例 #3
0
ファイル: Window.cs プロジェクト: jrs1498/IsometricProject
        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();
            };
        }
コード例 #4
0
ファイル: Button.cs プロジェクト: jrs1498/IsometricProject
 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;
 }
コード例 #5
0
ファイル: Button.cs プロジェクト: jrs1498/IsometricProject
 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)
 {
 }
コード例 #6
0
        /// <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;
        }
コード例 #7
0
        /// <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;
        }
コード例 #8
0
        /// <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;
        }
コード例 #9
0
ファイル: Dropdown.cs プロジェクト: jrs1498/IsometricProject
 /// <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();
 }
コード例 #10
0
ファイル: Window.cs プロジェクト: jrs1498/IsometricProject
        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
            };
        }
コード例 #11
0
ファイル: Window.cs プロジェクト: jrs1498/IsometricProject
        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;
                }
            };
        }
コード例 #12
0
ファイル: Window.cs プロジェクト: jrs1498/IsometricProject
 /// <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);
 }
コード例 #13
0
ファイル: Window.cs プロジェクト: jrs1498/IsometricProject
        /// <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);
        }
コード例 #14
0
ファイル: Window.cs プロジェクト: jrs1498/IsometricProject
 /// <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();
 }
コード例 #15
0
ファイル: Dropdown.cs プロジェクト: jrs1498/IsometricProject
 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));
         }
     };
 }
コード例 #16
0
ファイル: Dropdown.cs プロジェクト: jrs1498/IsometricProject
 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)
 {
 }
コード例 #17
0
        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;
        }
コード例 #18
0
ファイル: Dropdown.cs プロジェクト: jrs1498/IsometricProject
 /// <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();
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #21
0
 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;
 }