Summary description for TextDisplay.
Inheritance: Window
Ejemplo n.º 1
0
 public InfoBarWindow(Cursor cursor)
     : base(cursor)
 {
     mCursorTextDisplay = new TextDisplay(mCursor);
     AddWindow(mCursorTextDisplay);
     mCursorTextDisplay.X = 1;
 }
Ejemplo n.º 2
0
        public OkListWindow(string message, string title)
            : base(GuiManager.Cursor)
        {
            mName = title;
            ScaleX = 13;
            ScaleY = 15;
            HasMoveBar = true;
            HasCloseButton = true;
            MinimumScaleX = 9;
            MinimumScaleY = 10;

            mOkButton = new Button(mCursor);
            AddWindow(mOkButton);
            mOkButton.ScaleX = 1.7f;
			mOkButton.ScaleY = 1.2f;
            mOkButton.Text = "Ok";
			mOkButton.Click += new GuiMessage(OkButtonClicked);

            mMessageTextDisplay = new TextDisplay(mCursor);
            AddWindow(mMessageTextDisplay);
            mMessageTextDisplay.Text = message;
            mMessageTextDisplay.X = 1;
            mMessageTextDisplay.Y = 1.4f;

            mListBox = new ListBox(mCursor);
            AddWindow(mListBox);
            mListBox.StrongSelect += ShowSelectedItemInNewWindow;

            this.Resizable = true;
            Resizing += WindowResize;

            WindowResize(this);

            GuiManager.AddDominantWindow(this);
        }
Ejemplo n.º 3
0
 public InfoBarWindow(Cursor cursor)
     : base(cursor)
 {
     mCursorTextDisplay = new TextDisplay(mCursor);
     AddWindow(mCursorTextDisplay);
     mCursorTextDisplay.X = 1;
     mTimeLastSave = TimeManager.CurrentTime;
 }
Ejemplo n.º 4
0
        internal PropertyWindowAssociation(IWindow window, TextDisplay label,
                                           Type type, string memberName, bool canRead, bool canWrite, MemberTypes memberType, bool isStatic)
        {
            Window = window; Label = label;  Type = type; MemberName = memberName;

            CanRead  = canRead;
            CanWrite = canWrite;

            ReferencedMemberType = memberType;

            IsStatic = isStatic;
        }
        public AdvancedShapeCollectionLoadingWindow(Cursor cursor, MultiButtonMessageBox mbmb, TypesToLoad typesToLoad) : base(cursor)
        {
            this.AddWindow(mbmb);

            this.ScaleX = mbmb.ScaleX + 12.5f;
            mbmb.DrawBorders = false;
            mbmb.X = mbmb.ScaleX;

            mbmb.RemoveButton(mbmb.GetButton("Advanced >>"));
            // Maybe one day we want to allow the user to go back to the 
            // basic view?  It's a pain, so I won't do that now

            mbmb.Y = mbmb.ScaleY;
            this.ScaleY = mbmb.ScaleY + 1;


            //Button cancelButton = mbmb.GetButton("Cancel");
            //mbmb.RemoveButton(cancelButton);
            mbmb.HasMoveBar = false;
            mbmb.HasCloseButton = false;
            this.HasMoveBar = true;

            //mbmb.AddButton(cancelButton);

            TextDisplay textDisplay = new TextDisplay(cursor);
            textDisplay.Text = "Offset";
            this.AddWindow(textDisplay);
            textDisplay.X = mbmb.ScaleX * 2;
            textDisplay.Y = 1;

            offsetWindow = new Vector3Display(cursor);
            this.AddWindow(offsetWindow);
            offsetWindow.X = mbmb.ScaleX * 2 + offsetWindow.ScaleX ;
            offsetWindow.Y = offsetWindow.ScaleY + 2;

            mbmb.Closing += new GuiMessage(CloseThis);
            this.Name = "";

            PropertyGrid<TypesToLoad> propertyGrid = new PropertyGrid<TypesToLoad>(cursor);
            propertyGrid.ObjectDisplaying = typesToLoad;
            propertyGrid.HasMoveBar = false;
            propertyGrid.HasCloseButton = false;

            this.AddWindow(propertyGrid);
            propertyGrid.X = mbmb.ScaleX * 2 + propertyGrid.ScaleX - 1; // subtract 1 because we're not going to show the frames
            propertyGrid.Y = propertyGrid.ScaleY + 2 + offsetWindow.ScaleY * 2 + .5f;

            propertyGrid.DrawBorders = false;

        }
Ejemplo n.º 6
0
        public InfoBar(Cursor cursor)
            : base(cursor)
        {
            ScaleX = GuiManager.Camera.XEdge;
            ScaleY = MenuStrip.MenuStripHeight / 2.0f;

            X  = ScaleX - .001f;
            Y  = 2 * GuiManager.Camera.YEdge - ScaleY;
            Y += .001f;

            mTextDisplay = new TextDisplay(mCursor);
            AddWindow(mTextDisplay);
            mTextDisplay.X = 1;

            mTextDisplay.Text = "";
        }
Ejemplo n.º 7
0
        public InfoBar(Cursor cursor)
            : base(cursor)
        {
            ScaleX = GuiManager.Camera.XEdge;
            ScaleY = MenuStrip.MenuStripHeight / 2.0f;

            X = ScaleX - .001f;
            Y = 2 * GuiManager.Camera.YEdge - ScaleY;
            Y += .001f;

            mTextDisplay = new TextDisplay(mCursor);
            AddWindow(mTextDisplay);
            mTextDisplay.X = 1;

            mTextDisplay.Text = "";

        }
Ejemplo n.º 8
0
        public Vector3Display(Cursor cursor)
            : base(cursor)
        {
            float border = .5f;

            this.ScaleX = 6f;
            this.ScaleY = 3.5f;

            #region Create the UpDowns and set their static properties

            mXUpDown = new UpDown(mCursor);
            AddWindow(mXUpDown);

            mYUpDown = new UpDown(mCursor);
            AddWindow(mYUpDown);

            mZUpDown = new UpDown(mCursor);
            AddWindow(mZUpDown);

            mWUpDown = new UpDown(mCursor);
            AddWindow(mWUpDown);

            mXUpDown.Y = border + 1;
            mYUpDown.Y = border + 3;
            mZUpDown.Y = border + 5;
            mWUpDown.Y = border + 7;


            mXUpDown.ValueChanged += OnValueChanged;
            mYUpDown.ValueChanged += OnValueChanged;
            mZUpDown.ValueChanged += OnValueChanged;
            mWUpDown.ValueChanged += OnValueChanged;

            mXUpDown.LosingFocus += ComponentLosingFocus;
            mYUpDown.LosingFocus += ComponentLosingFocus;
            mZUpDown.LosingFocus += ComponentLosingFocus;
            mWUpDown.LosingFocus += ComponentLosingFocus;

            mXUpDown.AfterValueChanged += OnAfterValueChanged;
            mYUpDown.AfterValueChanged += OnAfterValueChanged;
            mZUpDown.AfterValueChanged += OnAfterValueChanged;
            mWUpDown.AfterValueChanged += OnAfterValueChanged;

            mXUpDown.FocusUpdate += OnFocusUpdateInternal;
            mYUpDown.FocusUpdate += OnFocusUpdateInternal;
            mZUpDown.FocusUpdate += OnFocusUpdateInternal;
            mWUpDown.FocusUpdate += OnFocusUpdateInternal;

            mXUpDown.GainFocus += OnGainFocusInternal;
            mYUpDown.GainFocus += OnGainFocusInternal;
            mZUpDown.GainFocus += OnGainFocusInternal;
            mWUpDown.GainFocus += OnGainFocusInternal;

            #endregion

            #region Create the TextDisplays and set their static properties
            mXDisplay = new TextDisplay(mCursor);
            AddWindow(mXDisplay);

            mYDisplay = new TextDisplay(mCursor);
            AddWindow(mYDisplay);

            mZDisplay = new TextDisplay(mCursor);
            AddWindow(mZDisplay);

            mWDisplay = new TextDisplay(mCursor);
            AddWindow(mWDisplay);

            mXDisplay.Text = "X:";
            mYDisplay.Text = "Y:";
            mZDisplay.Text = "Z:";
            mWDisplay.Text = "W:";

            mXDisplay.X = 0f;
            mYDisplay.X = 0f;
            mZDisplay.X = 0f;
            mWDisplay.X = 0f;

            mXDisplay.Y = mXUpDown.Y;
            mYDisplay.Y = mYUpDown.Y;
            mZDisplay.Y = mZUpDown.Y;
            mWDisplay.Y = mWUpDown.Y;

            #endregion

            float spaceForDisplay = 1;

            #region Set the UpDown ScaleX values

            mXUpDown.ScaleX = this.ScaleX - border - spaceForDisplay;
            mYUpDown.ScaleX = this.ScaleX - border - spaceForDisplay;
            mZUpDown.ScaleX = this.ScaleX - border - spaceForDisplay;
            mWUpDown.ScaleX = this.ScaleX - border - spaceForDisplay;

            #endregion

            mXUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX;
            mYUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX;
            mZUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX;
            mWUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX;

            NumberOfComponents = 3;
        }
Ejemplo n.º 9
0
        public ColorDisplay(Cursor cursor)
            : base(cursor)
        {
            float border = .5f;

            this.ScaleX = 7f;
            this.ScaleY = 6f;

            float spaceForDisplay = 1;


            #region Create the sliders

            mASlider = new TimeLine(cursor);
            mRSlider = new TimeLine(cursor);
            mGSlider = new TimeLine(cursor);
            mBSlider = new TimeLine(cursor);

            AddWindow(mASlider);
            AddWindow(mRSlider);
            AddWindow(mGSlider);
            AddWindow(mBSlider);

            mASlider.Y = border + 3.2f;
            mRSlider.Y = border + 5.5f;
            mGSlider.Y = border + 7.8f;
            mBSlider.Y = border + 10.1f;

            mASlider.GuiChange += OnSliderValueChanged;
            mRSlider.GuiChange += OnSliderValueChanged;
            mGSlider.GuiChange += OnSliderValueChanged;
            mBSlider.GuiChange += OnSliderValueChanged;

            // Since the ranges are identical don't show them for
            // all sliders, just the top.
            mASlider.ShowValues = true;
            mRSlider.ShowValues = false;
            mGSlider.ShowValues = false;
            mBSlider.ShowValues = false;

            mASlider.VerticalBarIncrement = .5f * FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mRSlider.VerticalBarIncrement = .5f * FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mGSlider.VerticalBarIncrement = .5f * FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mBSlider.VerticalBarIncrement = .5f * FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;

            mASlider.SmallVerticalBarIncrement = mASlider.VerticalBarIncrement / 2.0f;
            mRSlider.SmallVerticalBarIncrement = mRSlider.VerticalBarIncrement / 2.0f;
            mGSlider.SmallVerticalBarIncrement = mGSlider.VerticalBarIncrement / 2.0f;
            mBSlider.SmallVerticalBarIncrement = mBSlider.VerticalBarIncrement / 2.0f;


            mASlider.ValueWidth = FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mRSlider.ValueWidth = FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mGSlider.ValueWidth = FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mBSlider.ValueWidth = FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;

            mASlider.ScaleX = this.ScaleX - border - spaceForDisplay;
            mRSlider.ScaleX = this.ScaleX - border - spaceForDisplay;
            mGSlider.ScaleX = this.ScaleX - border - spaceForDisplay;
            mBSlider.ScaleX = this.ScaleX - border - spaceForDisplay;

            mASlider.X = border + spaceForDisplay * 2 + mASlider.ScaleX;
            mRSlider.X = border + spaceForDisplay * 2 + mRSlider.ScaleX;
            mGSlider.X = border + spaceForDisplay * 2 + mGSlider.ScaleX;
            mBSlider.X = border + spaceForDisplay * 2 + mBSlider.ScaleX;




            #endregion

            #region Create the TextDisplays
            mADisplay = new TextDisplay(mCursor);
            AddWindow(mADisplay);

            mRDisplay = new TextDisplay(mCursor);
            AddWindow(mRDisplay);

            mGDisplay = new TextDisplay(mCursor);
            AddWindow(mGDisplay);

            mBDisplay = new TextDisplay(mCursor);
            AddWindow(mBDisplay);

            mADisplay.X = .2f;
            mRDisplay.X = .2f;
            mGDisplay.X = .2f;
            mBDisplay.X = .2f;

            mADisplay.Text = "A";
            mRDisplay.Text = "R";
            mGDisplay.Text = "G";
            mBDisplay.Text = "B";

            mADisplay.Y = mASlider.Y;
            mRDisplay.Y = mRSlider.Y;
            mGDisplay.Y = mGSlider.Y;
            mBDisplay.Y = mBSlider.Y;
            #endregion

        }
        internal PropertyWindowAssociation(IWindow window, TextDisplay label, 
            Type type, string memberName, bool canRead, bool canWrite, MemberTypes memberType, bool isStatic)
        {

            Window = window; Label = label;  Type = type; MemberName = memberName;

            CanRead = canRead;
            CanWrite = canWrite;

            ReferencedMemberType = memberType;

            IsStatic = isStatic;
        }
Ejemplo n.º 11
0
        public Vector3Display(Cursor cursor)
            : base(cursor)
        {
            float border = .5f;
            this.ScaleX = 6f;
            this.ScaleY = 3.5f;

            #region Create the UpDowns and set their static properties

            mXUpDown = new UpDown(mCursor);
            AddWindow(mXUpDown);

            mYUpDown = new UpDown(mCursor);
            AddWindow(mYUpDown);

            mZUpDown = new UpDown(mCursor);
            AddWindow(mZUpDown);

            mWUpDown = new UpDown(mCursor);
            AddWindow(mWUpDown);
            
            mXUpDown.Y = border + 1;
            mYUpDown.Y = border + 3;
            mZUpDown.Y = border + 5;
            mWUpDown.Y = border + 7;


            mXUpDown.ValueChanged += OnValueChanged;
            mYUpDown.ValueChanged += OnValueChanged;
            mZUpDown.ValueChanged += OnValueChanged;
            mWUpDown.ValueChanged += OnValueChanged;

            mXUpDown.LosingFocus += ComponentLosingFocus;
            mYUpDown.LosingFocus += ComponentLosingFocus;
            mZUpDown.LosingFocus += ComponentLosingFocus;
            mWUpDown.LosingFocus += ComponentLosingFocus;

            mXUpDown.AfterValueChanged += OnAfterValueChanged;
            mYUpDown.AfterValueChanged += OnAfterValueChanged;
            mZUpDown.AfterValueChanged += OnAfterValueChanged;
            mWUpDown.AfterValueChanged += OnAfterValueChanged;

            mXUpDown.FocusUpdate += OnFocusUpdateInternal;
            mYUpDown.FocusUpdate += OnFocusUpdateInternal;
            mZUpDown.FocusUpdate += OnFocusUpdateInternal;
            mWUpDown.FocusUpdate += OnFocusUpdateInternal;

            mXUpDown.GainFocus += OnGainFocusInternal;
            mYUpDown.GainFocus += OnGainFocusInternal;
            mZUpDown.GainFocus += OnGainFocusInternal;
            mWUpDown.GainFocus += OnGainFocusInternal;

            #endregion

            #region Create the TextDisplays and set their static properties
            mXDisplay = new TextDisplay(mCursor);
            AddWindow(mXDisplay);

            mYDisplay = new TextDisplay(mCursor);
            AddWindow(mYDisplay);

            mZDisplay = new TextDisplay(mCursor);
            AddWindow(mZDisplay);

            mWDisplay = new TextDisplay(mCursor);
            AddWindow(mWDisplay);

            mXDisplay.Text = "X:";
            mYDisplay.Text = "Y:";
            mZDisplay.Text = "Z:";
            mWDisplay.Text = "W:";

            mXDisplay.X = 0f;
            mYDisplay.X = 0f;
            mZDisplay.X = 0f;
            mWDisplay.X = 0f;

            mXDisplay.Y = mXUpDown.Y;
            mYDisplay.Y = mYUpDown.Y;
            mZDisplay.Y = mZUpDown.Y;
            mWDisplay.Y = mWUpDown.Y;

            #endregion

            float spaceForDisplay = 1;

            #region Set the UpDown ScaleX values

            mXUpDown.ScaleX = this.ScaleX - border - spaceForDisplay;
            mYUpDown.ScaleX = this.ScaleX - border - spaceForDisplay;
            mZUpDown.ScaleX = this.ScaleX - border - spaceForDisplay;
            mWUpDown.ScaleX = this.ScaleX - border - spaceForDisplay;

            #endregion

            mXUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX;
            mYUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX;
            mZUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX;
            mWUpDown.X = border + spaceForDisplay * 2 + mXUpDown.ScaleX;

            NumberOfComponents = 3;
        }
Ejemplo n.º 12
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);
        }
Ejemplo n.º 13
0
        // 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);
        }
        public UsedPropertySelectionWindow()
            : base(GuiManager.Cursor)
        {
            GuiManager.AddWindow(this);
            HasMoveBar = true;
            ScaleX = 18;
            ScaleY = 23;
            MinimumScaleX = 14;
            MinimumScaleY = 10;
            Resizable = true;
            Resizing += SetChildrenWindowPositionsAndScales;


            mOkButton = AddButton();
            mOkButton.Text = "Ok";
            mOkButton.ScaleX = 3;
            mOkButton.Click += OkButtonClick;

            mCancelButton = AddButton();
            mCancelButton.Text = "Cancel";
            mCancelButton.ScaleX = 3;
            mCancelButton.Click += CancelButtonClick;

            mAllProperties = AddListBox();
            mAllProperties.StrongSelect += AddSelectedProperty;

            mPropertiesToSave = AddListBox();
            mPropertiesToSave.StrongSelect += RemoveSelectedProperty;

            mAllPropertiesDisplay = AddTextDisplay();
            mAllPropertiesDisplay.Text = "All properties:";

            mPropertiesToSaveDisplay = AddTextDisplay();
            mPropertiesToSaveDisplay.Text = "Properties to save:";

            mUseAllButton = AddButton();
            mUseAllButton.Text = "Use All ->";
            mUseAllButton.ScaleX = 4;
            mUseAllButton.Click += UseAllClick;

            SetChildrenWindowPositionsAndScales(null);

            PopulateFromStringLists();

        }
Ejemplo n.º 15
0
        public ColorDisplay(Cursor cursor)
            : base(cursor)
        {
            float border = .5f;

            this.ScaleX = 7f;
            this.ScaleY = 6f;

            float spaceForDisplay = 1;


            #region Create the sliders

            mASlider = new TimeLine(cursor);
            mRSlider = new TimeLine(cursor);
            mGSlider = new TimeLine(cursor);
            mBSlider = new TimeLine(cursor);

            AddWindow(mASlider);
            AddWindow(mRSlider);
            AddWindow(mGSlider);
            AddWindow(mBSlider);

            mASlider.Y = border + 3.2f;
            mRSlider.Y = border + 5.5f;
            mGSlider.Y = border + 7.8f;
            mBSlider.Y = border + 10.1f;

            mASlider.GuiChange += OnSliderValueChanged;
            mRSlider.GuiChange += OnSliderValueChanged;
            mGSlider.GuiChange += OnSliderValueChanged;
            mBSlider.GuiChange += OnSliderValueChanged;

            // Since the ranges are identical don't show them for
            // all sliders, just the top.
            mASlider.ShowValues = true;
            mRSlider.ShowValues = false;
            mGSlider.ShowValues = false;
            mBSlider.ShowValues = false;

            mASlider.VerticalBarIncrement = .5f * FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mRSlider.VerticalBarIncrement = .5f * FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mGSlider.VerticalBarIncrement = .5f * FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mBSlider.VerticalBarIncrement = .5f * FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;

            mASlider.SmallVerticalBarIncrement = mASlider.VerticalBarIncrement / 2.0f;
            mRSlider.SmallVerticalBarIncrement = mRSlider.VerticalBarIncrement / 2.0f;
            mGSlider.SmallVerticalBarIncrement = mGSlider.VerticalBarIncrement / 2.0f;
            mBSlider.SmallVerticalBarIncrement = mBSlider.VerticalBarIncrement / 2.0f;


            mASlider.ValueWidth = FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mRSlider.ValueWidth = FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mGSlider.ValueWidth = FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;
            mBSlider.ValueWidth = FlatRedBall.Graphics.GraphicalEnumerations.MaxColorComponentValue;

            mASlider.ScaleX = this.ScaleX - border - spaceForDisplay;
            mRSlider.ScaleX = this.ScaleX - border - spaceForDisplay;
            mGSlider.ScaleX = this.ScaleX - border - spaceForDisplay;
            mBSlider.ScaleX = this.ScaleX - border - spaceForDisplay;

            mASlider.X = border + spaceForDisplay * 2 + mASlider.ScaleX;
            mRSlider.X = border + spaceForDisplay * 2 + mRSlider.ScaleX;
            mGSlider.X = border + spaceForDisplay * 2 + mGSlider.ScaleX;
            mBSlider.X = border + spaceForDisplay * 2 + mBSlider.ScaleX;



            #endregion

            #region Create the TextDisplays
            mADisplay = new TextDisplay(mCursor);
            AddWindow(mADisplay);

            mRDisplay = new TextDisplay(mCursor);
            AddWindow(mRDisplay);

            mGDisplay = new TextDisplay(mCursor);
            AddWindow(mGDisplay);

            mBDisplay = new TextDisplay(mCursor);
            AddWindow(mBDisplay);

            mADisplay.X = .2f;
            mRDisplay.X = .2f;
            mGDisplay.X = .2f;
            mBDisplay.X = .2f;

            mADisplay.Text = "A";
            mRDisplay.Text = "R";
            mGDisplay.Text = "G";
            mBDisplay.Text = "B";

            mADisplay.Y = mASlider.Y;
            mRDisplay.Y = mRSlider.Y;
            mGDisplay.Y = mGSlider.Y;
            mBDisplay.Y = mBSlider.Y;
            #endregion
        }
Ejemplo n.º 16
0
        // Methods
        public SpriteRigSaveOptions(GuiMessages messages, Cursor cursor)
            : base(cursor)
        {
            this.messages = messages;
            GuiManager.AddWindow(this);
            this.ScaleX = 13f;
            this.ScaleY = 17f;
            base.HasMoveBar = true;
            base.mName = "SpriteRig Options";
            base.HasCloseButton = true;

            TextDisplay tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Include:";
            tempTextDisplay.SetPositionTL(0.2f, 1.5f);

            this.sceneOrGroup = new ComboBox(mCursor);
            AddWindow(sceneOrGroup);
            this.sceneOrGroup.ScaleX = 8f;
            this.sceneOrGroup.SetPositionTL(10f, 3.5f);
            this.sceneOrGroup.Text = "Entire Scene";
            this.sceneOrGroup.AddItem("Current Group");
            this.sceneOrGroup.AddItem("Entire Scene");

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Body Sprite Selection Includes:";
            tempTextDisplay.SetPositionTL(0.2f, 6f);

            this.bodySpriteSelectionMethod = new ComboBox(mCursor);
            AddWindow(bodySpriteSelectionMethod);
            this.bodySpriteSelectionMethod.ScaleX = 8f;
            this.bodySpriteSelectionMethod.SetPositionTL(10f, 8.5f);
            this.bodySpriteSelectionMethod.Text = "Name Includes";
            this.bodySpriteSelectionMethod.AddItem("Name Includes");
            this.bodySpriteSelectionMethod.AddItem("By Texture");
            this.bodySpriteSelectionMethod.AddItem("All Not Joint");
            this.bodySpriteSelectionMethod.AddItem("All");
            this.bodySpriteSelectionMethod.ItemClick += new GuiMessage(this.bodySpriteSelectionMethodClicked);

            this.bodyAvailableTextures = new ComboBox(mCursor);
            AddWindow(bodyAvailableTextures);
            this.bodyAvailableTextures.ScaleX = 8f;
            this.bodyAvailableTextures.SetPositionTL(10f, 10.5f);
            this.bodyAvailableTextures.Visible = false;

            this.bodyNameToInclude = new TextBox(mCursor);
            AddWindow(bodyNameToInclude);
            this.bodyNameToInclude.ScaleX = 8f;
            this.bodyNameToInclude.SetPositionTL(10f, 10.5f);

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Joint Sprite Selection Includes:";
            tempTextDisplay.SetPositionTL(0.2f, 13f);

            this.jointSpriteSelectionMethod = new ComboBox(mCursor);
            AddWindow(jointSpriteSelectionMethod);
            this.jointSpriteSelectionMethod.ScaleX = 8f;
            this.jointSpriteSelectionMethod.SetPositionTL(10f, 15.5f);
            this.jointSpriteSelectionMethod.Text = "Name Includes";
            this.jointSpriteSelectionMethod.AddItem("Name Includes");
            this.jointSpriteSelectionMethod.AddItem("By Texture");
            this.jointSpriteSelectionMethod.AddItem("All Not Body");
            this.jointSpriteSelectionMethod.AddItem("All");
            this.jointSpriteSelectionMethod.ItemClick += new GuiMessage(this.jointSpriteSelectionMethodClicked);

            this.jointAvailableTextures = new ComboBox(mCursor);
            AddWindow(jointAvailableTextures);
            this.jointAvailableTextures.ScaleX = 8f;
            this.jointAvailableTextures.SetPositionTL(10f, 18f);
            this.jointAvailableTextures.Visible = false;

            this.jointNameToInclude = new TextBox(mCursor);
            AddWindow(jointNameToInclude);
            this.jointNameToInclude.ScaleX = 8f;
            this.jointNameToInclude.SetPositionTL(10f, 18f);

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Root Sprite:";
            tempTextDisplay.SetPositionTL(0.2f, 20);

            this.rootSpriteComboBox = new ComboBox(mCursor);
            AddWindow(rootSpriteComboBox);
            this.rootSpriteComboBox.ScaleX = 8f;
            this.rootSpriteComboBox.SetPositionTL(10f, 22.5f);
            this.rootSpriteComboBox.Text = "<No Root>";

            tempTextDisplay = new TextDisplay(mCursor);
            AddWindow(tempTextDisplay);
            tempTextDisplay.Text = "Sprite Visibility:";
            tempTextDisplay.SetPositionTL(0.2f, 25f);

            this.jointsVisible = new ToggleButton(mCursor);
            AddWindow(jointsVisible);
            this.jointsVisible.SetPositionTL(11f, 27f);
            this.jointsVisible.SetText("Joints Not Visible", "Joints Visible");
            this.jointsVisible.ScaleX = 7.5f;

            this.rootVisible = new ToggleButton(mCursor);
            AddWindow(rootVisible);
            this.rootVisible.SetPositionTL(11f, 29f);
            this.rootVisible.SetText("Root Not Visible", "Root Visible");
            this.rootVisible.ScaleX = 7.5f;

            this.okButton = new Button(mCursor);
            AddWindow(okButton);
            this.okButton.Text = "Save";
            this.okButton.ScaleX = 4.5f;
            this.okButton.ScaleY = 1.3f;
            this.okButton.SetPositionTL(5f, 32f);
            this.okButton.Click += new GuiMessage(this.saveButtonClick);

            this.cancelButton = new Button(mCursor);
            AddWindow(cancelButton);
            this.cancelButton.Text = "Cancel";
            this.cancelButton.ScaleX = 4.5f;
            this.cancelButton.ScaleY = 1.3f;
            this.cancelButton.SetPositionTL(16f, 32f);
            this.cancelButton.Click += new GuiMessage(this.cancelButtonClick);

            this.Visible = false;
        }
        public ModelAnimationControlWindow(PositionedModel model)
            : base(GuiManager.Cursor)
        {
            // Set Window properties
            HasMoveBar = true;
            Resizable = true;
            HasCloseButton = true;
            
            // Set scaling
            ScaleX = 20f;

            // Add combo boxes
            mCurrentAnimation = new ComboBox(mCursor);
            AddWindow(mCurrentAnimation);

            mBlendAnimation = new ComboBox(mCursor);
            AddWindow(mBlendAnimation);

            mCurrentAnimation.ItemClick += new GuiMessage(mCurrentAnimation_ItemClick);
            mBlendAnimation.ItemClick += new GuiMessage(mBlendAnimation_ItemClick);

            // Add text
            mCurrentAnimationText = new TextDisplay(mCursor);
            AddWindow(mCurrentAnimationText);

            mBlendAnimationText = new TextDisplay(mCursor);
            AddWindow(mBlendAnimationText);

            mCurrentAnimationText.Text = "Current Animation";
            mBlendAnimationText.Text = "Blend Animation";

            // Blend controller
            mBlendController = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendController);
            mBlendController.ScaleX = 18f;
            mBlendController.MinimumValue = 0.0;
            mBlendController.MaximumValue = 1.0;
            mBlendController.Start = 0.0;
            mBlendController.ValueWidth = 1.0;
            mBlendController.VerticalBarIncrement = 0.1;
            mBlendController.CurrentValue = 0.0;
            mBlendController.GuiChange += new GuiMessage(mBlendController_onGUIChange);

            // Animation timings
            mAnimationTime = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mAnimationTime);
            mAnimationTime.ScaleX = 9f;
            mAnimationTime.VerticalBarIncrement = 0.2;
            mAnimationTime.SmallVerticalBarIncrement = 0.1;
            mAnimationTime.ValueWidth = 1;
            mAnimationTime.GuiChange += new GuiMessage(mAnimationTime_onGUIChange);

            mBlendTime = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendTime);
            mBlendTime.ScaleX = 9f;
            mBlendTime.VerticalBarIncrement = 0.2;
            mBlendTime.SmallVerticalBarIncrement = 0.1;
            mBlendTime.ValueWidth = 1;
            mBlendTime.GuiChange += new GuiMessage(mBlendTime_onGUIChange);

            // Animation speeds
            mAnimationSpeed = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mAnimationSpeed);
            mAnimationSpeed.ScaleX = 9f;
            mAnimationSpeed.MinimumValue = 0.0;
            mAnimationSpeed.MaximumValue = 2.0;
            mAnimationSpeed.Start = 0.0;
            mAnimationSpeed.ValueWidth = 2.0;
            mAnimationSpeed.VerticalBarIncrement = 0.5;
            mAnimationSpeed.SmallVerticalBarIncrement = 0.1;
            mAnimationSpeed.CurrentValue = 1.0;
            mAnimationSpeed.GuiChange += new GuiMessage(mAnimationSpeed_onGUIChange);

            mBlendSpeed = new TimeLine(GuiManager.Cursor);
            this.AddWindow(mBlendSpeed);
            mBlendSpeed.ScaleX = 9f;
            mBlendSpeed.MinimumValue = 0.0;
            mBlendSpeed.MaximumValue = 2.0;
            mBlendSpeed.Start = 0.0;
            mBlendSpeed.ValueWidth = 2.0;
            mBlendSpeed.VerticalBarIncrement = 0.5;
            mBlendSpeed.SmallVerticalBarIncrement = 0.1;
            mBlendSpeed.CurrentValue = 1.0;
            mBlendSpeed.GuiChange += new GuiMessage(mBlendSpeed_onGUIChange);

            mAnimationStopStart = new Button(GuiManager.Cursor);
            this.AddWindow(mAnimationStopStart);
            mAnimationStopStart.ScaleX = 5f;
            mAnimationStopStart.Text = "Stop";
            mAnimationStopStart.Click += new GuiMessage(mAnimationStopStart_Click);

            // Set scaling
            mCurrentAnimation.ScaleX = 9f;
            mBlendAnimation.ScaleX = 9f;
            mCurrentAnimationText.ScaleY = 1f;// mCurrentAnimation.ScaleY;
            mCurrentAnimationText.ScaleX = mCurrentAnimation.ScaleX;
            mBlendAnimationText.ScaleY = 1f;// mBlendAnimation.ScaleY;
            mBlendAnimationText.ScaleX = mBlendAnimation.ScaleX;

            ScaleY = mCurrentAnimationText.ScaleY + mCurrentAnimation.ScaleY +
                2f * mBlendController.ScaleY + 2f * mAnimationTime.ScaleY +
                2f * mAnimationSpeed.ScaleY + 2f * mAnimationStopStart.ScaleY +
                .5f;
            ScaleX = (mCurrentAnimation.ScaleX + mBlendAnimation.ScaleX) + 4.5f / 2f;

            PositionUIElements();

            Resizing += new GuiMessage(AnimationEditor_Resizing);

            // Add model
            PositionedModel = model;
        }