示例#1
0
        /// <summary>
        /// Instantiates a new ScrollBar instance.  The new instance will not automatically be
        /// added to the GuiManager.
        /// </summary>
        /// <param name="cursor">The Cursor that the ScrollBar will interact with.</param>
        #endregion
        public ScrollBar(Cursor cursor) : 
            base(cursor)
		{

            upButton = new Button(mCursor);
            AddWindow(upButton);

            downButton = new Button(mCursor);
            AddWindow(downButton);

            mPositionBar = new Button(mCursor);
            AddWindow(mPositionBar);

			upButton.Click += new GuiMessage(OnUpButtonClick);
			downButton.Click += new GuiMessage(OnDownButtonClick);

			upButton.ScaleX = upButton.ScaleY = downButton.ScaleX = downButton.ScaleY = .95f;
			mSensitivity = .1;

			View = .1f;

            mPositionBar.SetPositionTL(0, 3);
			this.mNumberOfVertices = 6 + 6 + 18 + 18; // top button + bottom button + scrollbar (3*6) + base (3*6)

            ScaleX = 1;
            ScaleY = 5;
            FixBar();

        }
示例#2
0
        public ActivityWindow()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            ScaleX = 10;
            ScaleY = 6.5f;
            HasCloseButton = true;
            HasMoveBar = true;
            SetPositionTL(10, 52f);

            emitCurrent = new Button(mCursor);
            AddWindow(emitCurrent);
            emitCurrent.ScaleX = 4.8f;
            emitCurrent.SetPositionTL(ScaleX - 4.6f, 2);
            emitCurrent.ScaleY = 1f;
            emitCurrent.Text = "Emit Current";
            emitCurrent.Click += new GuiMessage(emitCurrentClick);

            emitAll = new Button(mCursor);
            AddWindow(emitAll);
            emitAll.ScaleX = 4.5f;
            emitAll.SetPositionTL(ScaleX + 5, 2);
            emitAll.ScaleY = 1f;
            emitAll.Text = "Emit All";
            emitAll.Click += new GuiMessage(emitAllClick);


            startStopCurrent = new ToggleButton(mCursor);
            AddWindow(startStopCurrent);
            startStopCurrent.ScaleX = 4.8f;
            startStopCurrent.SetText("Start Current", "Stop Current");
            startStopCurrent.SetPositionTL(ScaleX - 4.6f, 5);

            startStopAll = new ToggleButton(mCursor);
            AddWindow(startStopAll);
            startStopAll.ScaleX = 4.5f;
            startStopAll.SetText("Start All", "Stop All");
            startStopAll.SetPositionTL(ScaleX + 5, 5);

            clearAllButton = new Button(mCursor);
            AddWindow(clearAllButton);
            clearAllButton.ScaleX = 8.5f;
            clearAllButton.ScaleY = 1.5f;
            clearAllButton.SetPositionTL(ScaleX, 8);
            clearAllButton.Text = ("Clear All");
            clearAllButton.Click += new GuiMessage(clearAllButtonClick);

            numberOfSpritesDisplay = new TextDisplay(mCursor);
            AddWindow(numberOfSpritesDisplay);
            numberOfSpritesDisplay.Text = "Number of Sprites: 0";
            numberOfSpritesDisplay.SetPositionTL(ScaleX - 10, 11);
        }
        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";

        }
示例#4
0
        /// <summary>
        /// Creates a new TimeLine;
        /// </summary>
        /// <param name="cursor">The Cursor that will interact with the TimeLine.</param>
        #endregion
        public TimeLine(Cursor cursor) : 
            base(cursor)
		{
			mMinimumValue = 0;
			mMaximumValue = double.PositiveInfinity;;
			mStart = 0;
			mValueWidth = 100;

            mScaleX = 10;
            mScaleY = 1.5f;

            positionBar = new Button(mCursor);
            AddWindow(positionBar);

			positionBar.ScaleX = .5f;
			positionBar.ScaleY = 1;
			positionBar.Dragging += new GuiMessage(PositionBarDrag);
			positionBar.SetPositionTL(0, ScaleY);

            positionBar.overlayTL = new FlatRedBall.Math.Geometry.Point(0, 225 / 256.0f);
            positionBar.overlayTR = new FlatRedBall.Math.Geometry.Point(1 / 256.0f, 225 / 256.0f);
            positionBar.overlayBL = new FlatRedBall.Math.Geometry.Point(1 / 256.0f, 226 / 256.0f);
            positionBar.overlayBR = new FlatRedBall.Math.Geometry.Point(0, 226 / 256.0f);

            positionBar.Name = "TimeLine position bar";

	
			SetBarToValue();

			this.Click += new GuiMessage(ClickEvent);
        }
示例#5
0
        public ComboBoxWindow()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            ScaleX = 12;
            ScaleY = 9;
            this.Closing += GuiManager.RemoveWindow;
            
            mTextField = new TextField();
            mTextField.SetDimensions(-2, -8, 1, 23, 0);
            mTextField.Z = 100;
            mTextField.WindowParent = this;

            mComboBox = new ComboBox(mCursor);
            AddWindow(mComboBox);
            mComboBox.ScaleX = ScaleX - 2;
            mComboBox.ScaleY = 1.4f;
            mComboBox.SetPositionTL(ScaleX, 2 * ScaleY - 5);

            mCancelButton = new Button(mCursor);
            AddWindow(mCancelButton);
            mCancelButton.ScaleY = 1.5f;
            mCancelButton.Text = "Cancel";
            mCancelButton.SetPositionTL(2 * ScaleX - 5.2f, 2 * ScaleY - 2);
            mCancelButton.Click += GuiManager.RemoveWindow;

            mOkButton = new Button(mCursor);
            AddWindow(mOkButton);
            mOkButton.ScaleY = 1.5f;
            mOkButton.Text = "Ok";
            mOkButton.SetPositionTL(5.2f, 2 * ScaleY - 2);
        }
示例#6
0
        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");


        }
示例#7
0
        /// <summary>
        /// Instantiates a new ScrollBar using a GuiSkin.  The new instance will not automatically be
        /// added to the GuiManager.
        /// </summary>
        /// <param name="guiSkin">The GuiSkin to customize the appearance of the ScrollBar.</param>
        /// <param name="cursor">The Cursor that the ScrollBar will interact with.</param>
        #endregion
        public ScrollBar(GuiSkin guiSkin, Cursor cursor)
            : base(guiSkin, cursor)
        {
            mScaleX = 1;
            mScaleY = 1;

            upButton = new Button(guiSkin, cursor);
            base.AddWindow(upButton);

            downButton = new Button(guiSkin, cursor);
            base.AddWindow(downButton);
            
            mPositionBar = new Button(guiSkin, cursor);
            base.AddWindow(mPositionBar);

            upButton.SpriteFrame.RelativeZ = -.01f * FlatRedBall.Math.MathFunctions.ForwardVector3.Z;
            downButton.SpriteFrame.RelativeZ = -.01f * FlatRedBall.Math.MathFunctions.ForwardVector3.Z;
            mPositionBar.SpriteFrame.RelativeZ = -.01f * FlatRedBall.Math.MathFunctions.ForwardVector3.Z;

            upButton.SpriteFrame.RelativeY = 10;
            downButton.SpriteFrame.RelativeY = -10;


            upButton.Click += new GuiMessage(OnUpButtonClick);
            downButton.Click += new GuiMessage(OnDownButtonClick);

           // upButton.ScaleX = upButton.ScaleY = downButton.ScaleX = downButton.ScaleY = .95f;

            mSensitivity = .1;

            View = .1f;

            mPositionBar.SetPositionTL(mScaleX, 3);
        }
示例#8
0
        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
        }
        // Methods
        public DeleteTextureWindow(Texture2D textureToDelete, List<Texture2D> allTextures)
            : base(GuiManager.Cursor)
        {
            this.textureToDelete = textureToDelete;
            this.allTextures = allTextures;
            GuiManager.AddWindow(this);
            this.ScaleX = 15f;
            this.ScaleY = 10.5f;
            base.HasMoveBar = true;
            base.mName = "Delete " + FileManager.MakeRelative(textureToDelete.Name, FileManager.RelativeDirectory) + "?";

            mMessage = new TextDisplay(mCursor);
            AddWindow(mMessage);
            mMessage.Text = 
                FileManager.MakeRelative(textureToDelete.Name, FileManager.RelativeDirectory) + 
                " is being referenced by other objects.  What would you like to do?";
            mMessage.X = .5f;
            mMessage.Y = 1.3f;
            mMessage.Text = TextManager.InsertNewLines(
                mMessage.Text, GuiManager.TextSpacing, this.ScaleX * 2 - 1, TextManager.DefaultFont);
            //throw new NotImplementedException("Need to support the text field here");


            this.comboBox = new ComboBox(mCursor);
            AddWindow(comboBox);
            this.comboBox.SetPositionTL(this.ScaleX, 13f);
            this.comboBox.ScaleX = 13f;
            this.comboBox.AddItem("Delete objects referencing texture");
            if (allTextures.Count > 1)
            {
                this.comboBox.AddItem("Replace texture");
            }
            this.comboBox.Text = "Delete objects referencing texture";
            this.comboBox.ItemClick += new GuiMessage(this.ComboBoxOptionSelect);

            this.textureList = new ComboBox(mCursor);
            AddWindow(textureList);
            this.textureList.ScaleX = 13f;
            this.textureList.SetPositionTL(this.ScaleX, 15.5f);
            this.textureList.Visible = false;
            foreach (Texture2D frbt in allTextures)
            {
                if (frbt != textureToDelete)
                {
                    if (this.textureList.Count == 0)
                    {
                        this.textureList.Text = frbt.Name;
                    }
                    this.textureList.AddItem(frbt.Name, frbt);
                }
            }
            Button okButton = new Button(mCursor);
            AddWindow(okButton);
            okButton.Text = "Ok";
            okButton.ScaleX = 3.5f;
            okButton.ScaleY = 1.4f;
            okButton.SetPositionTL(7f, 18.5f);
            okButton.Click += new GuiMessage(this.OkButtonClick);

            Button cancelButton = new Button(mCursor);
            AddWindow(cancelButton);
            cancelButton.Text = "Cancel";
            cancelButton.ScaleX = 3.5f;
            cancelButton.ScaleY = 1.4f;
            cancelButton.SetPositionTL(23f, 18.5f);
            cancelButton.Click += new GuiMessage(this.ClosingWindow);
        }
示例#10
0
        public UpDown(Cursor cursor) : 
            base(cursor)
		{
            if (GuiManager.guiTexture == null)
            {
                throw new System.NullReferenceException("GuiTexture not set - cannot add UpDown");
            }

			mScaleX = 4.2f;
			mScaleY = 1.3f;
			MaxValue = float.PositiveInfinity;
			MinValue = float.NegativeInfinity;
			mCurrentValue = 0;
			mChange = 0;
			Sensitivity = .1f;

            mUpDownButton = new Button(mCursor);
            AddWindow(mUpDownButton);
			mUpDownButton.SetPositionTL(ScaleX + 2.2f, ScaleY);
			mUpDownButton.ScaleX = .6f;
            mUpDownButton.ScaleY = 1;
            mUpDownButton.MouseWheelScroll += MouseWheelEvent;

            mTextBox = new TextBox(mCursor);
            AddWindow(mTextBox);
			mTextBox.SetPositionTL(ScaleX - 1.0f, ScaleY);
			mTextBox.ScaleX = 2.8f;
			mTextBox.Format = TextBox.FormatTypes.Decimal;
			mTextBox.Text = mCurrentValue.ToString();
            mTextBox.MouseWheelScroll += MouseWheelEvent;

            SetInternalEvents();
			//this.onLosingFocus += new GuiMessage(textBoxChangeValue);
		}