Inheritance: CameraPropertyGrid
Exemple #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
        }
Exemple #2
0
        private static void CreatePropertyGrids()
        {
            #region Camera PropertyGrid
            mCameraPropertyGrid = new CameraPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mCameraPropertyGrid);
            mCameraPropertyGrid.SelectedObject = SpriteManager.Camera;
            mCameraPropertyGrid.X = mCameraPropertyGrid.ScaleX;
            mCameraPropertyGrid.Y = 40;
            mCameraPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mCameraPropertyGrid.Name = "Camera";
            mCameraPropertyGrid.Visible = false;
            #endregion

            #region Scene Camera PropertyGrid
            mSceneCameraPropertyGrid = new CameraBoundsPropertyGrid(EditorData.BoundsCamera);
            // This doesn't get added to the GuiManager because it was created before the pattern was established that PropertyGrids don't add themselves.
            mSceneCameraPropertyGrid.Visible = false;
            mSceneCameraPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mSceneCameraPropertyGrid.Name = "Camera Bounds";
            #endregion

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

            #region LineGrid PropertyGrid
            mLineGridPropertyGrid = new LineGridPropertyGrid(EditorData.LineGrid);
            mLineGridPropertyGrid.Visible = false;

            #endregion
        }
Exemple #3
0
        static void CreatePropertyGrids()
        {            
            PropertyGrid.SetPropertyGridTypeAssociation(typeof(FlatRedBall.Instructions.InstructionBlueprint), typeof(InstructionBlueprintPropertyGrid<Sprite>));


            #region EmitterPropertyGrid
            mEmitterPropertyGrid = new EmitterPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mEmitterPropertyGrid);
            EmitterPropertyGrid.ContentManagerName = AppState.Self.PermanentContentManager;
            EmitterPropertyGrid.UndoInstructions = UndoManager.Instructions;

            #region Reset EmissionSettings Button
            Button settingsButton = EmitterPropertyGrid.GetUIElementForMember("EmissionSettings") as Button;

            Type t = typeof(Window);
            FieldInfo f = t.GetField("Click", BindingFlags.Default | BindingFlags.SetField | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
            f.SetValue(settingsButton, null);

            settingsButton.Click += ShowEmissionSettingsPropertyGrid;
            #endregion
            #endregion

            #region Editor CameraPropertyGrid
            mCameraPropertyGrid = new CameraPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mCameraPropertyGrid);
            mCameraPropertyGrid.SelectedObject = SpriteManager.Camera;
            mCameraPropertyGrid.MakeFieldOfViewAndAspectRatioReadOnly();
            mCameraPropertyGrid.Visible = false;
            #endregion

            #region Bounds CameraPropertyGrid

            mCameraBoundsPropertyGrid = new CameraBoundsPropertyGrid(
                new Camera(AppState.Self.PermanentContentManager));

            mCameraBoundsPropertyGrid.Visible = false;

            #endregion

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

            #region ScenePropertyGrid
            mScenePropertyGrid = new ScenePropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mScenePropertyGrid);
            mScenePropertyGrid.HasCloseButton = true;
            mScenePropertyGrid.Visible = false;
            mScenePropertyGrid.ShowPropertyGridOnStrongSelect = true;
            #endregion

            #region EmissionSettingsPropertyGrid


            List<String> filterList = new List<String>();
            filterList.Add("ordered");
            filterList.Add("JustCycled");
            filterList.Add("TimeUntilNextFrame");
            filterList.Add("TimeCreated");
            filterList.Add("state");
            filterList.Add("Name");

            InstructionBlueprintPropertyGrid<Sprite>.MemberFilter.Add(typeof(Sprite), filterList);


            mEmissionSettingsPropertyGrid = new EmissionSettingsPropertyGrid(GuiManager.Cursor);
            GuiManager.AddWindow(mEmissionSettingsPropertyGrid);
            mEmissionSettingsPropertyGrid.HasCloseButton = true;
            mEmissionSettingsPropertyGrid.Visible = false;
            mEmissionSettingsPropertyGrid.ContentManagerName = AppState.Self.PermanentContentManager;
            mEmissionSettingsPropertyGrid.UndoInstructions = UndoManager.Instructions;
            mEmissionSettingsPropertyGrid.InstructionDisplayWindow.ListDisplayWindow.ListBox.CursorOver += MouseOverEmissionSettingsGrid;

            #endregion
        }