Пример #1
0
        private static void CreatePropertyGrids()
        {
            PropertyGrid.SetPropertyGridTypeAssociation(typeof(Sprite), typeof(SpritePropertyGrid));

            #region EditorPropertiesGrid

            mEditorPropertiesGrid = new EditorPropertiesGrid();
            mEditorPropertiesGrid.Visible = false;
            mVisibleToggleWindows.Add(mEditorPropertiesGrid);
            #endregion

            #region SpriteFramePropertyGrid

            mSpriteFramePropertyGrid = new SpriteFramePropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mSpriteFramePropertyGrid);
            mSpriteFramePropertyGrid.Visible = false;
            mSpriteFramePropertyGrid.X = 19.3f;
            mSpriteFramePropertyGrid.Y = 61.2f;
            mSpriteFramePropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mSpriteFramePropertyGrid.UndoInstructions = UndoManager.Instructions;

            mSpriteFramePropertyGrid.ShowWarningOnNonPowerOfTwoTexture = true;

            mVisibleToggleWindows.Add(mSpriteFramePropertyGrid);
            #endregion

            #region SpritePropertyGrid

            mSpritePropertyGrid = new SpritePropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mSpritePropertyGrid);
            mSpritePropertyGrid.Visible = false;
            mSpritePropertyGrid.X = 17.8f;
            mSpritePropertyGrid.Y = 61.2f;
            mSpritePropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mSpritePropertyGrid.UndoInstructions = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mSpritePropertyGrid);
            mSpritePropertyGrid.SetMemberChangeEvent("Texture", ChangeTextureThroughPropertyGrid);
            mSpritePropertyGrid.ShowWarningOnNonPowerOfTwoTexture = true;

			mSpritePropertyGrid.EnableSplittingSprite(GameData.Scene.Sprites);

            SpritePropertyGrid.ExtraCamerasForScale.Add(GameData.BoundsCamera);
            #endregion

            #region SpriteGridPropertyGrid

            mSpriteGridPropertyGrid = new SpriteGridPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mSpriteGridPropertyGrid);
            mSpriteGridPropertyGrid.Visible = false;
            mSpriteGridPropertyGrid.X = 17.8f;
            mSpriteGridPropertyGrid.Y = 61.2f;
            mSpriteGridPropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mSpriteGridPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mSpriteGridPropertyGrid);


            #endregion

            #region PositionedModelPropertyGrid

            mPositionedModelPropertyGrid = new PositionedModelPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mPositionedModelPropertyGrid);
            mPositionedModelPropertyGrid.Visible = false;
            mPositionedModelPropertyGrid.X = 17.8f;
            mPositionedModelPropertyGrid.Y = 61.2f;
            mPositionedModelPropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mPositionedModelPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mPositionedModelPropertyGrid);
            #endregion

            #region TextPropertyGrid

            mTextPropertyGrid = new TextPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mTextPropertyGrid);
            mTextPropertyGrid.Visible = false;
            mTextPropertyGrid.X = 17.8f;
            mTextPropertyGrid.Y = 61.2f;
            mTextPropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mTextPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mTextPropertyGrid);
            TextPropertyGrid.ExtraCamerasForScale.Add(GameData.BoundsCamera);
            #endregion

            #region GraphicsOptionsPropertyGrid

            mGraphicsOptionsPropertyGrid = new GraphicsOptionsPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mGraphicsOptionsPropertyGrid);
            mGraphicsOptionsPropertyGrid.Visible = false;
            mGraphicsOptionsPropertyGrid.X = 17.8f;
            mGraphicsOptionsPropertyGrid.Y = 61.2f;
            mGraphicsOptionsPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mGraphicsOptionsPropertyGrid);
            #endregion

            #region Camera bounds PropertyGrid

            mCameraBoundsPropertyGrid = new EditorObjects.Gui.CameraBoundsPropertyGrid(GameData.BoundsCamera);
            mCameraBoundsPropertyGrid.SelectedObject = GameData.BoundsCamera;
            mCameraBoundsPropertyGrid.Visible = false;
            mVisibleToggleWindows.Add(mCameraBoundsPropertyGrid);
            #endregion

            #region Camera PropertyGrid
            mCameraPropertyGrid = new CameraPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mCameraPropertyGrid);
            mCameraPropertyGrid.MakeFieldOfViewAndAspectRatioReadOnly();
            mCameraPropertyGrid.ShowDestinationRectangle(false);
            mCameraPropertyGrid.X = mCameraPropertyGrid.ScaleX;
            mCameraPropertyGrid.Y = 61.2f;
            mVisibleToggleWindows.Add(mCameraPropertyGrid);
            #endregion
        }
Пример #2
0
        private static void CreatePropertyGrids()
        {
            PropertyGrid.SetPropertyGridTypeAssociation(typeof(Sprite), typeof(SpritePropertyGrid));

            #region EditorPropertiesGrid

            mEditorPropertiesGrid         = new EditorPropertiesGrid();
            mEditorPropertiesGrid.Visible = false;
            mVisibleToggleWindows.Add(mEditorPropertiesGrid);
            #endregion

            #region SpriteFramePropertyGrid

            mSpriteFramePropertyGrid = new SpriteFramePropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mSpriteFramePropertyGrid);
            mSpriteFramePropertyGrid.Visible            = false;
            mSpriteFramePropertyGrid.X                  = 19.3f;
            mSpriteFramePropertyGrid.Y                  = 61.2f;
            mSpriteFramePropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mSpriteFramePropertyGrid.UndoInstructions   = UndoManager.Instructions;

            mSpriteFramePropertyGrid.ShowWarningOnNonPowerOfTwoTexture = true;

            mVisibleToggleWindows.Add(mSpriteFramePropertyGrid);
            #endregion

            #region SpritePropertyGrid

            mSpritePropertyGrid = new SpritePropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mSpritePropertyGrid);
            mSpritePropertyGrid.Visible            = false;
            mSpritePropertyGrid.X                  = 17.8f;
            mSpritePropertyGrid.Y                  = 61.2f;
            mSpritePropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mSpritePropertyGrid.UndoInstructions   = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mSpritePropertyGrid);
            mSpritePropertyGrid.SetMemberChangeEvent("Texture", ChangeTextureThroughPropertyGrid);
            mSpritePropertyGrid.ShowWarningOnNonPowerOfTwoTexture = true;

            mSpritePropertyGrid.EnableSplittingSprite(GameData.Scene.Sprites);

            SpritePropertyGrid.ExtraCamerasForScale.Add(GameData.BoundsCamera);
            #endregion

            #region SpriteGridPropertyGrid

            mSpriteGridPropertyGrid = new SpriteGridPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mSpriteGridPropertyGrid);
            mSpriteGridPropertyGrid.Visible            = false;
            mSpriteGridPropertyGrid.X                  = 17.8f;
            mSpriteGridPropertyGrid.Y                  = 61.2f;
            mSpriteGridPropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mSpriteGridPropertyGrid.UndoInstructions   = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mSpriteGridPropertyGrid);


            #endregion

            #region PositionedModelPropertyGrid

            mPositionedModelPropertyGrid = new PositionedModelPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mPositionedModelPropertyGrid);
            mPositionedModelPropertyGrid.Visible            = false;
            mPositionedModelPropertyGrid.X                  = 17.8f;
            mPositionedModelPropertyGrid.Y                  = 61.2f;
            mPositionedModelPropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mPositionedModelPropertyGrid.UndoInstructions   = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mPositionedModelPropertyGrid);
            #endregion

            #region TextPropertyGrid

            mTextPropertyGrid = new TextPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mTextPropertyGrid);
            mTextPropertyGrid.Visible            = false;
            mTextPropertyGrid.X                  = 17.8f;
            mTextPropertyGrid.Y                  = 61.2f;
            mTextPropertyGrid.ContentManagerName = GameData.SceneContentManager;
            mTextPropertyGrid.UndoInstructions   = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mTextPropertyGrid);
            TextPropertyGrid.ExtraCamerasForScale.Add(GameData.BoundsCamera);
            #endregion

            #region GraphicsOptionsPropertyGrid

            mGraphicsOptionsPropertyGrid = new GraphicsOptionsPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mGraphicsOptionsPropertyGrid);
            mGraphicsOptionsPropertyGrid.Visible          = false;
            mGraphicsOptionsPropertyGrid.X                = 17.8f;
            mGraphicsOptionsPropertyGrid.Y                = 61.2f;
            mGraphicsOptionsPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mVisibleToggleWindows.Add(mGraphicsOptionsPropertyGrid);
            #endregion

            #region Camera bounds PropertyGrid

            mCameraBoundsPropertyGrid = new EditorObjects.Gui.CameraBoundsPropertyGrid(GameData.BoundsCamera);
            mCameraBoundsPropertyGrid.SelectedObject = GameData.BoundsCamera;
            mCameraBoundsPropertyGrid.Visible        = false;
            mVisibleToggleWindows.Add(mCameraBoundsPropertyGrid);
            #endregion

            #region Camera PropertyGrid
            mCameraPropertyGrid = new CameraPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mCameraPropertyGrid);
            mCameraPropertyGrid.MakeFieldOfViewAndAspectRatioReadOnly();
            mCameraPropertyGrid.ShowDestinationRectangle(false);
            mCameraPropertyGrid.X = mCameraPropertyGrid.ScaleX;
            mCameraPropertyGrid.Y = 61.2f;
            mVisibleToggleWindows.Add(mCameraPropertyGrid);
            #endregion
        }