public SetOverlayTextures ( FlatRedBall.Texture2D upTexture, FlatRedBall.Texture2D downTexture ) : void | ||
upTexture | FlatRedBall.Texture2D | |
downTexture | FlatRedBall.Texture2D | |
리턴 | void |
public ToolsWindow(Cursor cursor) : base() { messages = GuiData.Messages; SetPositionTL(3.5f, 63.8f); HasCloseButton = true; moveObject = AddToggleButton(); moveObject.Text = "Move"; moveObject.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>("Content/icons/Tools/move.tga", AppState.Self.PermanentContentManager), null); attachObject = AddToggleButton(); attachObject.Text = "Attach"; moveObject.AddToRadioGroup(attachObject); attachObject.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>("Content/icons/attach.tga", AppState.Self.PermanentContentManager), null); detachObject = AddButton(); detachObject.Text = "Detach"; detachObject.Enabled = false; detachObject.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>("Content/icons/detach.tga", AppState.Self.PermanentContentManager), null); detachObject.Click += new GuiMessage(messages.DetachObjectClick); copyEmitter = AddButton(); copyEmitter.Text = "Copy"; copyEmitter.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>("Content/icons/duplicate.tga", AppState.Self.PermanentContentManager), null); copyEmitter.Click += new GuiMessage(CopyEmitterClick); copyEmitter.Enabled = false ; scaleEmitterTime = AddButton(); scaleEmitterTime.Text = "Scale Emitter Speed"; scaleEmitterTime.SetOverlayTextures(15, 2); scaleEmitterTime.Click += new GuiMessage(ScaleEmitterTimeClick); scaleEmitterTime.Enabled = false; #region DownZFreeRotateButton this.mDownZFreeRotateButton = base.AddToggleButton(); mDownZFreeRotateButton.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>(@"Content\DownZ.png", FlatRedBallServices.GlobalContentManager), FlatRedBallServices.Load<Texture2D>(@"Content\FreeRotation.png", FlatRedBallServices.GlobalContentManager)); #endregion }
public TimeControlButtonWindow(Cursor cursor) : base(cursor) { //GuiManager.AddWindow(this); SetPositionTL(5.2f, 40); ScaleX = 5.2f; ScaleY = 1.95f; mName = "Time Controls"; mMoveBar = true; toStartButton = new Button(mCursor); AddWindow(toStartButton); toStartButton.SetPositionTL(1.9f, 1.9f); toStartButton.ScaleX = 1.5f; toStartButton.ScaleY = 1.5f; toStartButton.SetOverlayTextures(10, 1); toStartButton.Click += new GuiMessage(toStartButtonClick); toStartButton.Text = "To Start"; stopButton = new Button(mCursor); AddWindow(stopButton); stopButton.SetPositionTL(5.1f, 1.9f); stopButton.ScaleX = 1.5f; stopButton.ScaleY = 1.5f; stopButton.SetOverlayTextures(11, 1); stopButton.Click += new GuiMessage(stopButtonClick); stopButton.Text = "Stop"; playButton = new ToggleButton(mCursor); AddWindow(playButton); playButton.SetPositionTL(8.3f, 1.9f); playButton.ScaleX = 1.5f; playButton.ScaleY = 1.5f; playButton.SetOverlayTextures(9, 1); playButton.Click += new GuiMessage(playButtonClick); playButton.Text = "Play"; }
private void CreateButtons() { #region Consts used in button creation const float buttonScaleX = 2.0f; const float buttonScaleY = 1.5f; const float distanceBetweenButtons = .5f; const float buttonY = 5; #endregion int buttonsAddedSoFar = 0; #region To Start mToStart = new Button(mCursor); AddWindow(mToStart); mToStart.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>(@"Content\ToStartButton.png", FlatRedBallServices.GlobalContentManager), null); mToStart.ScaleX = buttonScaleX; mToStart.ScaleY = buttonScaleY; mToStart.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX); mToStart.Y = buttonY; mToStart.Click += ToStartClick; buttonsAddedSoFar++; #endregion #region Play mPlay = new ToggleButton(mCursor); AddWindow(mPlay); mPlay.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>(@"Content\PlayButton.png", FlatRedBallServices.GlobalContentManager), null); mPlay.ScaleX = buttonScaleX; mPlay.ScaleY = buttonScaleY; mPlay.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX); mPlay.Y = buttonY; mPlay.Click += PlayClick; buttonsAddedSoFar++; #endregion #region Pause mPause = new ToggleButton(mCursor); AddWindow(mPause); mPause.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>(@"Content\PauseButton.png", FlatRedBallServices.GlobalContentManager), null); mPause.ScaleX = buttonScaleX; mPause.ScaleY = buttonScaleY; mPause.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX); mPause.Y = buttonY; mPause.Click += PauseClick; buttonsAddedSoFar++; #endregion mStop = new Button(mCursor); AddWindow(mStop); mStop.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>(@"Content\StopButton.png", FlatRedBallServices.GlobalContentManager), null); mStop.ScaleX = buttonScaleX; mStop.ScaleY = buttonScaleY; mStop.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX); mStop.Y = buttonY; mStop.Click += StopClick; buttonsAddedSoFar++; mLoadSong = new Button(mCursor); AddWindow(mLoadSong); mLoadSong.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>(@"Content\EjectButton.png", FlatRedBallServices.GlobalContentManager), null); mLoadSong.ScaleX = buttonScaleX; mLoadSong.ScaleY = buttonScaleY; mLoadSong.X = distanceBetweenButtons + buttonScaleX + buttonsAddedSoFar * (distanceBetweenButtons + 2 * buttonScaleX); mLoadSong.Y = buttonY; mLoadSong.Click += OpenSongWindow; buttonsAddedSoFar++; }
/// <summary> /// Creates a new FileWindow. /// </summary> /// <remarks> /// By default, the save name TextBox is invisible making this a text box for loading. Call /// SetToSave to make the box appear. /// </remarks> /// <param name="InpMan"></param> /// <param name="SprMan"></param> internal FileWindow(Cursor cursor) : base(cursor) { #region Create the "settings" directory if (System.IO.Directory.Exists(ApplicationFolderForThisProgram + "settings") == false) System.IO.Directory.CreateDirectory(ApplicationFolderForThisProgram + "settings"); #endregion #region Set "this" properties this.HasMoveBar = true; this.Closing += new GuiMessage(OnFileWindowClose); mScaleX = 20; mScaleY = 20; this.Resizable = true; this.Resizing += new GuiMessage(SetGUIPosition); this.OkClick += new GuiMessage(AddFileToRecent); this.Closing += OnClose; MinimumScaleX = 13; MinimumScaleY = 16; #endregion mFileTypes = new List<string>(); #region Create the Texture display button mTextureDisplayButton = new Button(mCursor); AddWindow(mTextureDisplayButton); mTextureDisplayButton.ScaleY = 4; mTextureDisplayButton.ScaleX = 4; mTextureDisplayButton.Click += ShowChildTextureDisplayWindow; #endregion #region Create the Bookmark button mBookmarkToggleButton = new ToggleButton(mCursor); AddWindow(mBookmarkToggleButton); mBookmarkToggleButton.ScaleX = mBookmarkToggleButton.ScaleY = 1.3f; mBookmarkToggleButton.SetPositionTL(.5f + mBookmarkToggleButton.ScaleX, .5f + mBookmarkToggleButton.ScaleY); mBookmarkToggleButton.Click += BookmarkButtonClick; mBookmarkToggleButton.SetOverlayTextures( 9, 3); #endregion #region CurrentDirectoryDisplay Combo Box mCurrentDirectoryDisplay = new ComboBox(mCursor); base.AddWindow(mCurrentDirectoryDisplay); mCurrentDirectoryDisplay.ItemClick += ChangeSelectedDirectory; mCurrentDirectoryDisplay.TextChange += ChangeSelectedDirectory; mCurrentDirectoryDisplay.AllowTypingInTextBox = true; ResetCurrentDirectoryComboBox(); #endregion #region Create the ListBox mListBox = new ListBox(mCursor); AddWindow(mListBox); mListBox.SortingStyle = ListBoxBase.Sorting.None; mListBox.Highlight += new GuiMessage(OnListBoxClick); mListBox.StrongSelect += new GuiMessage(OnListBoxStrongSelect); mListBox.EscapeRelease += new GuiMessage(CloseFileWindow); mListBox.CurrentToolTipOption = ListBoxBase.ToolTipOption.CursorOver; #endregion #region Create the Ok Button mOkButton = new Button(mCursor); AddWindow(mOkButton); mOkButton.Text = "Ok"; mOkButton.Click += new GuiMessage(OkButtonClick); #endregion #region Create the Cancel button mCancelButton = new Button(mCursor); AddWindow(mCancelButton); mCancelButton.Text = "Cancel"; mCancelButton.Click += OnCancelClick; #endregion #region Create the Load Directory Button loadDirectory = new Button(mCursor); AddWindow(loadDirectory); loadDirectory.Text = "Load Dir"; loadDirectory.Click += new GuiMessage(LoadDirClick); loadDirectory.Visible = false; #endregion //#region Create the "Add" button //addButton = new Button(mCursor); //AddWindow(addButton); //addButton.ScaleX = 4; //addButton.ScaleY = 1.5f; //addButton.Text = "Add"; //addButton.Click += new GuiMessage(AddButtonClick); //addButton.Visible = false; //#endregion #region Create the Up Directory button mUpDirectory = new Button(mCursor); AddWindow(mUpDirectory); #if FRB_MDX // This is always null in the new engines - not sure how this button gets its texture. mUpDirectory.SetOverlayTextures(GuiManager.mUpDirectory, null); #endif mUpDirectory.ScaleY = 1; mUpDirectory.ScaleX = 1; mUpDirectory.Text = "Up One Directory"; mUpDirectory.overlayTL = new FlatRedBall.Math.Geometry.Point(0.38281250, 0.6445312500); mUpDirectory.overlayTR = new FlatRedBall.Math.Geometry.Point(0.42968750, 0.6445312500); mUpDirectory.overlayBL = new FlatRedBall.Math.Geometry.Point(0.38281250, 0.687500000); mUpDirectory.overlayBR = new FlatRedBall.Math.Geometry.Point(0.42968750, 0.687500000); mUpDirectory.Click += this.UpOneDirectoryClick; #endregion mCreateNewDirectory = new Button(mCursor); base.AddWindow(mCreateNewDirectory); mCreateNewDirectory.SetOverlayTextures(5, 3); mCreateNewDirectory.ScaleX = 1; mCreateNewDirectory.ScaleY = 1; mCreateNewDirectory.Text = "Create New\nDirectory"; mCreateNewDirectory.Click += AddDirectoryClick; saveName = new TextBox(mCursor); AddWindow(saveName); saveName.ScaleY = 1.4f; saveName.Visible = false; saveName.fixedLength = false; saveName.EnterPressed += new GuiMessage(OnSaveNameEnter); saveName.EscapeRelease += new GuiMessage(CloseFileWindow); Name = "Loading File"; // displayTextureLoadedBefore = false; mShowFileHierarchy = new ToggleButton(mCursor); AddWindow(mShowFileHierarchy); mShowFileHierarchy.SetPositionTL(7.0f, 4.5f); mShowFileHierarchy.ScaleX = 5.5f; mShowFileHierarchy.Text = "File Hierarchy"; mShowFileHierarchy.SetOneAlwaysDown(true); mShowFileHierarchy.Click += new GuiMessage(OnFileHierarchyClick); mAllRelativeToggleButton = new ToggleButton(mCursor); AddWindow(mAllRelativeToggleButton); mAllRelativeToggleButton.SetPositionTL(7.0f, 6.5f); mAllRelativeToggleButton.ScaleX = 5.5f; mAllRelativeToggleButton.Text = "All Relative"; mAllRelativeToggleButton.Click += new GuiMessage(OnAllRelativeClick); mAllRelativeToggleButton.SetOneAlwaysDown(true); mAllRelativeToggleButton.AddToRadioGroup(mShowFileHierarchy); mShowRecent = new ToggleButton(mCursor); AddWindow(mShowRecent); mShowRecent.SetPositionTL(19, 4.5f); mShowRecent.ScaleX = 5.5f; mShowRecent.Text = "Recent Files"; mShowRecent.Click += new GuiMessage(OnShowRecent); mShowRecent.SetOneAlwaysDown(true); mShowRecent.AddToRadioGroup(mShowFileHierarchy); // go here!!! mShowFileHierarchy.Press(); mFileTypeBox = new ComboBox(mCursor); AddWindow(mFileTypeBox); mFileTypeBox.ItemClick += OnFileTypeChange; #if XBOX360 || WINDOWS_PHONE || MONODROID SetDirectory(); #else SetDirectory(FileManager.MyDocuments); #endif SetGUIPosition(null); LoadBookmarks(); }
public ToolsWindow() : base() { #region Set managers and UI references this.messages = GuiData.messages; this.sesgMan = GameData.sesgMan; #endregion #region Set "this" properties base.SetPositionTL(106f, 5.8f); base.HasCloseButton = true; #endregion #region Move Button this.MoveButton = AddToggleButton(); this.MoveButton.Text = "Move"; this.MoveButton.SetOverlayTextures(2, 0); #endregion #region Scale Button this.ScaleButton = AddToggleButton(); this.ScaleButton.Text = "Scale"; this.MoveButton.AddToRadioGroup(this.ScaleButton); this.ScaleButton.SetOverlayTextures(1, 0); #endregion #region Rotate Button this.RotateButton = AddToggleButton(); this.RotateButton.Text = "Rotate"; this.MoveButton.AddToRadioGroup(this.RotateButton); this.RotateButton.SetOverlayTextures(0, 0); #endregion #region Attach Sprite this.attachSprite = base.AddToggleButton(); this.attachSprite.Text = "Attach"; this.MoveButton.AddToRadioGroup(this.attachSprite); this.attachSprite.SetOverlayTextures(7, 0); #endregion #region Detach Sprite this.detachSpriteButton = AddButton(); this.detachSpriteButton.Text = "Detach"; this.detachSpriteButton.Enabled = false; this.detachSpriteButton.SetOverlayTextures(10, 0); this.detachSpriteButton.Click += new GuiMessage(this.detachSprite); #endregion #region SetRootAsControlPoint this.setRootAsControlPoint = AddButton(); this.setRootAsControlPoint.Text = "Set Root As Control Point"; this.setRootAsControlPoint.Enabled = false; this.setRootAsControlPoint.SetOverlayTextures(12, 2); this.setRootAsControlPoint.Click += new GuiMessage(this.SetRootAsControlPointClick); #endregion #region Duplicate Objects this.mDuplicateObject = AddButton(); this.mDuplicateObject.Text = "Duplicate"; this.mDuplicateObject.SetOverlayTextures(9, 0); this.mDuplicateObject.Click += new GuiMessage(this.CopyCurrentObjects); #endregion #region Convert to SpriteGrid this.convertToSpriteGridButton = AddButton(); this.convertToSpriteGridButton.Text = "Convert Sprite to SpriteGrid"; this.convertToSpriteGridButton.SetOverlayTextures(2, 1); this.convertToSpriteGridButton.Enabled = false; this.convertToSpriteGridButton.Click += new GuiMessage(SpriteGridGuiMessages.ConvertToSpriteGridButtonClick); #endregion #region Convert to SpriteFrame this.convertToSpriteFrame = AddButton(); this.convertToSpriteFrame.Text = "Convert Sprite to SpriteFrame"; this.convertToSpriteFrame.SetOverlayTextures(1, 3); this.convertToSpriteFrame.Enabled = false; this.convertToSpriteFrame.Click += new GuiMessage(GameData.sfMan.ConvertToSpriteFrameClick); #endregion #region Paint Button this.paintButton = AddToggleButton(); this.paintButton.Text = "Paint"; this.paintButton.SetOverlayTextures(5, 1); this.MoveButton.AddToRadioGroup(this.paintButton); this.paintButton.Click += new GuiMessage(this.PaintButtonClicked); #endregion #region Current Texture Display this.currentTextureDisplay = AddButton(); this.currentTextureDisplay.Text = ""; this.currentTextureDisplay.Click += new GuiMessage(FileButtonWindow.openFileWindowLoadTexture); #endregion #region eyedropper this.eyedropper = AddToggleButton(); this.eyedropper.Text = "Eyedropper Tool"; this.eyedropper.SetOverlayTextures(8, 1); this.MoveButton.AddToRadioGroup(this.eyedropper); #endregion #region Brush size this.brushSize = new ComboBox(mCursor); AddWindow(brushSize); this.brushSize.SetPositionTL(4.2f, 12.5f); this.brushSize.ScaleY = 1.3f; this.brushSize.ScaleX = 3.8f; this.brushSize.AddItem("1X1"); this.brushSize.AddItem("3X3"); this.brushSize.AddItem("5X5"); this.brushSize.Text = "1X1"; this.brushSize.ExpandOnTextBoxClick = true; #endregion this.constrainDimensions = base.AddToggleButton(); this.constrainDimensions.SetPositionTL(constrainDimensions.X, 15.5f); this.constrainDimensions.Text = "Constrain Dim."; this.constrainDimensions.SetOverlayTextures(5, 0); #region Group/Hierarchy Button this.groupHierarchyControlButton = base.AddToggleButton(); this.groupHierarchyControlButton.SetText("Group Control", "Hierarchy Control"); this.groupHierarchyControlButton.SetOverlayTextures(3, 0, 4, 0); #endregion this.mSnapSprite = base.AddToggleButton(); this.mSnapSprite.Text = "Sprite Snapping"; this.mSnapSprite.SetOverlayTextures(6, 0); #region DownZFreeRotateButton this.mDownZFreeRotateButton = base.AddToggleButton(); mDownZFreeRotateButton.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>(@"Content\DownZ.png", FlatRedBallServices.GlobalContentManager), FlatRedBallServices.Load<Texture2D>(@"Content\FreeRotation.png", FlatRedBallServices.GlobalContentManager)); #endregion this.MinimumScaleX = this.ScaleX; this.MinimumScaleY = this.ScaleY; }
public TimeControlWindow() : base(GuiManager.Cursor) { GuiManager.AddWindow(this); SetPositionTL(11.5f, 72.6f); ScaleX = 11.5f; ScaleY = 1.95f; HasMoveBar = true; Name = "Time Controls"; toStartButton = AddButton(); toStartButton.SetPositionTL(1.9f, 1.9f); toStartButton.ScaleX = 1.5f; toStartButton.ScaleY = 1.5f; toStartButton.SetOverlayTextures(10, 1); toStartButton.Text = "To Start of Instruction Set"; toStartButton.Click += new GuiMessage(ToStartPushed); stopButton = AddButton(); stopButton.SetPositionTL(11.5f, 1.9f); stopButton.ScaleX = 1.5f; stopButton.ScaleY = 1.5f; stopButton.SetOverlayTextures(11, 1); stopButton.Text = "Stop"; stopButton.Click += new GuiMessage(StopPushed); playButton = AddToggleButton(); playButton.SetPositionTL(14.7f, 1.9f); playButton.ScaleX = 1.5f; playButton.ScaleY = 1.5f; playButton.SetOverlayTextures(9, 1); playButton.Text = "Play"; playButton.Click += new GuiMessage(PlayPushed); mCycleButton = AddToggleButton(); mCycleButton.SetPositionTL(17.9f, 1.9f); mCycleButton.ScaleX = 1.5f; mCycleButton.ScaleY = 1.5f; mCycleButton.SetOverlayTextures(8, 3); mCycleButton.SetText("Cycle Off", "Cycle On"); }
/* * This is the basic constructor for the GeometryWindow. It uses ToggleButtons instead of Buttons for a functionality aspect. * The desire was to have a single click on the button create 1 geometric shape, and then have the button * reset itself to the off position. The Button class may be used, but as of August 2nd, 2008, I don't believe has the * support for the desired functionality - Aaron */ public GeometryWindow() : base() { base.mName = "Geometry"; NumberOfRows = 5; this.X = SpriteManager.Camera.XEdge * 2 - this.ScaleX; this.Y = 19.0f; this.ExtraSpacingBetweenSameRowButtons = .2f; #region Add AxisAlignedRectangle this.mAxisAlignedRectangleButton = AddButton(Keys.P); this.mAxisAlignedRectangleButton.Text = "AxisAlignedRectangle (P)"; mAxisAlignedRectangleButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\AxisAlignedRectangle.png"), null); mAxisAlignedRectangleButton.Click += AddAxisAlignedRectangle; #endregion #region Add Circle this.mCircleButton = AddButton(Keys.O); this.mCircleButton.Text = "Circle (O)"; mCircleButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\Circle.png"), null); mCircleButton.Click += AddCircle; #endregion #region Add Polygon (Rectangle) this.mRectanglePolygonButton = AddButton(Keys.I); this.mRectanglePolygonButton.Text = "Rectangle Polygon (I)"; mRectanglePolygonButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\RectanglePolygon.png"), null); mRectanglePolygonButton.Click += AddRectanglePolygon; #endregion #region Add AxisAlignedCube this.mAxisAlignedCubeButton = AddButton(Keys.U); this.mAxisAlignedCubeButton.Text = "AxisAlignedCube (U)"; mAxisAlignedCubeButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\AxisAlignedCube.png"), null); mAxisAlignedCubeButton.Click += AddAxisAlignedCube; #endregion #region Add Sphere this.mSphereButton = AddButton(Keys.Y); this.mSphereButton.Text = "Sphere (Y)"; mSphereButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\Sphere.png"), null); mSphereButton.Click += AddSphere; #endregion #region Edit AxisAlignedRectangle mEditAxisAlignedRectangleButton = AddToggleButton(); mEditAxisAlignedRectangleButton.SetText("Currently NOT editing Axis Aligned Rectangles", "Currently editing Axis Aligned Rectangles"); Texture2D texture = FlatRedBallServices.Load<Texture2D>(@"Assets\UI\EditAxisAlignedRectangle.png"); mEditAxisAlignedRectangleButton.SetOverlayTextures( FlatRedBallServices.Load<Texture2D>(@"Assets\UI\NoEditAxisAlignedRectangle.png"), texture ); mEditAxisAlignedRectangleButton.Press(); #endregion #region Edit Circle mEditCircleButton = AddToggleButton(); mEditCircleButton.SetText("Currently NOT editing Circles", "Currently editing Circles"); texture = FlatRedBallServices.Load<Texture2D>(@"Assets\UI\EditCircle.png"); mEditCircleButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\NoEditCircle.png"), texture); mEditCircleButton.Press(); #endregion #region Edit Polygon mEditPolygonButton = AddToggleButton(); mEditPolygonButton.SetText("Currently NOT editing Polygons", "Currently editing Polygons"); texture = FlatRedBallServices.Load<Texture2D>(@"Assets\UI\EditPolygon.png"); mEditPolygonButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\NoEditPolygon.png"), texture); mEditPolygonButton.Press(); #endregion #region Edit AxisAlignedCube mEditAxisAlignedCubeButton = AddToggleButton(); mEditAxisAlignedCubeButton.SetText("Currently NOT editing Axis Aligned Cubes", "Currently editing Axis Aligned Cubes"); texture = FlatRedBallServices.Load<Texture2D>(@"Assets\UI\EditAxisAlignedCube.png"); mEditAxisAlignedCubeButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\NoEditAxisAlignedCube.png"), texture); mEditAxisAlignedCubeButton.Press(); #endregion #region Edit Sphere mEditSphereButton = AddToggleButton(); mEditSphereButton.SetText("Currently NOT editing Spheres", "Currently editing Spheres"); texture = FlatRedBallServices.Load<Texture2D>(@"Assets\UI\EditSphere.png"); mEditSphereButton.SetOverlayTextures(FlatRedBallServices.Load<Texture2D>(@"Assets\UI\NoEditSphere.png"), texture); mEditSphereButton.Press(); #endregion }
public TimeLineWindow(Cursor cursor) : base(cursor) { GuiManager.AddWindow(this); SetPositionTL(55.2f, 80.1f); ScaleX = 55.2f; ScaleY = 3.3f; mName = "Time Line"; #region Zoom in button zoomInTimeLineButton = AddButton(); zoomInTimeLineButton.SetPositionTL(104.7474f, 4.5f); zoomInTimeLineButton.ScaleX = 1.1f; zoomInTimeLineButton.ScaleY = 1.1f; zoomInTimeLineButton.Text = "Zoom in time line"; zoomInTimeLineButton.SetOverlayTextures(3, 2); zoomInTimeLineButton.Click += new GuiMessage(TimeLineMessages.ZoomInClick); #endregion #region Zoom out button zoomOutTimeLineButton = AddButton(); zoomOutTimeLineButton.SetPositionTL(102.2f, 4.5f); zoomOutTimeLineButton.ScaleX = 1.1f; zoomOutTimeLineButton.ScaleY = 1.1f; zoomOutTimeLineButton.Text = "Zoom out time line"; zoomOutTimeLineButton.SetOverlayTextures(2, 2); zoomOutTimeLineButton.Click += new GuiMessage(TimeLineMessages.ZoomOutClick); #endregion #region Current time TextBox currentTimeTextBox = AddTextBox(); currentTimeTextBox.SetPositionTL(92, 4.3f); currentTimeTextBox.ScaleX = 6; currentTimeTextBox.ScaleY = 1.1f; currentTimeTextBox.Format = TextBox.FormatTypes.Decimal; currentTimeTextBox.LosingFocus += new GuiMessage(TimeLineMessages.CurrentTimeTextBoxChange); currentTimeTextBox.Text = "0"; #endregion #region Insert Keyframe Button insertKeyframeButton = AddButton(); insertKeyframeButton.SetPositionTL(99.5f, 4.6f); insertKeyframeButton.ScaleX = 1.3f; insertKeyframeButton.ScaleY = 1.3f; insertKeyframeButton.Text = "Insert Keyframe"; insertKeyframeButton.SetOverlayTextures(4, 2); insertKeyframeButton.Click += new GuiMessage(TimeLineMessages.InsertKeyframeClick); insertKeyframeButton.Visible = false; // need to remove this. #endregion #region Time Line timeLine = new MarkerTimeLine(cursor); AddWindow(timeLine); timeLine.ScaleX = 42.0f; timeLine.ScaleY = 2; timeLine.SetPositionTL(43.0f, this.ScaleY * 2 - 2.4f); timeLine.GuiChange += new GuiMessage(TimeLineMessages.TimeLineGUIValueChange); timeLine.MarkerClick += new GuiMessage(TimeLineMessages.KeyframeMarkerClick); timeLine.Start = 0; timeLine.TimeUnitDisplayed = TimeLine.TimeUnit.Second; timeLine.MinimumValue = 0; timeLine.MaximumValue = 999; timeLine.ValueWidth = 20; timeLine.AutoCalculateVerticalLineSpacing(); #endregion timeUnit = this.AddComboBox(); timeUnit.ScaleX = 6f; timeUnit.AddItem("Milliseconds"); timeUnit.AddItem("Seconds"); timeUnit.Text = "Seconds"; timeUnit.SetPositionTL(92f, 1.8f); timeUnit.ItemClick += new GuiMessage(TimeLineMessages.TimeUnitChange); #region All or Current Combo Box mAllOrCurrent = this.AddComboBox(); mAllOrCurrent.ScaleX = 5; mAllOrCurrent.SetPositionTL(104, 1.8f); mAllOrCurrent.AddItem("All", InstructionMode.All); mAllOrCurrent.AddItem("Current", InstructionMode.Current); mAllOrCurrent.Text = "All"; mAllOrCurrent.SelectedObject = InstructionMode.All; mAllOrCurrent.ItemClick += AllOrCurrentItemClick; #endregion }