Beispiel #1
0
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGrid2DLEDArrayElement(ParamBlob blob)
        {
            this.diffuseTextureName = @"TextEditor\LEDArrayBkg";

            // blob
            this.width                 = blob.width;
            this.height                = blob.height;
            this.edgeSize              = blob.edgeSize;
            this.selectedColor         = blob.selectedColor.ToVector4();
            this.unselectedColor       = blob.unselectedColor.ToVector4();
            this.baseColor             = unselectedColor;
            this.altShader             = blob.altShader;
            this.altPreMultAlphaShader = blob.altPreMultAlphaShader;
            this.greyFlatShader        = blob.greyFlatShader;
            this.ignorePowerOf2        = blob.ignorePowerOf2;

            this.normalMapName = blob.normalMapName;
            this.elementName   = blob.elementName;

            leds        = new bool[25];
            ledHitBoxes = new AABB2D[25];
            for (int i = 0; i < 25; i++)
            {
                ledHitBoxes[i] = new AABB2D();
            }
        }   // end of c'tor
Beispiel #2
0
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridLevelElement(ParamBlob blob)
        {
            this.width  = blob.width;
            this.height = blob.height;

            this.Font      = blob.Font;
            this.textColor = blob.textColor;
        }
Beispiel #3
0
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGrid2DDualTextureElement(ParamBlob blob, string foreTextureName)
        {
            this.foreTextureName = foreTextureName;

            // blob
            this.width  = blob.width;
            this.height = blob.height;

            // Use to blend selected/unselected.  Start unselected.
            alpha = 0.0f;
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridModularNextLevelElement(ParamBlob blob)
        {
            // blob
            this.width    = blob.width;
            this.height   = blob.height;
            this.edgeSize = blob.edgeSize;

            this.Font    = blob.Font;
            this.justify = blob.justify;

            this.normalMapName = blob.normalMapName;
        }
        public UIGrid2DFloatingTextElement(ParamBlob blob, string label)
        {
            this.label = TextHelper.FilterInvalidCharacters(label);

            // blob
            this.Font = blob.Font;
            this.selectedTextColor   = blob.selectedColor;
            this.unselectedTextColor = blob.unselectedColor;
            this.dropShadowColor     = blob.dropShadowColor;


            width  = 1.0f;
            height = Font().LineSpacing / 96.0f;
        }   // end of c'tor
        // c'tor
        public UIGrid2DToolElement(ParamBlob blob, UIGrid parent, BaseTool tool)
            : base(blob, tool.IconTextureName)
        {
            this.tool        = tool;
            this.parent      = parent;
            this.description = tool.Description;

            NoZ = true;


            descLength = (int)(Font().MeasureString(description).X);

            textLine = new TextLine(this, description, Font, false);
        }   // end of c'tor
Beispiel #7
0
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridModularTextElement(ParamBlob blob, string label)
        {
            this.label = TextHelper.FilterInvalidCharacters(label);

            // blob
            this.width  = blob.width;
            this.height = blob.height;

            this.Font = blob.Font;
            this.selectedTextColor   = blob.selectedTextColor;
            this.unselectedTextColor = blob.unselectedTextColor;
            this.justify             = blob.justify;

            this.textColor = unselectedTextColor.ToVector4();
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.  This version allows for an overlay texture.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGrid2DTextureElement(ParamBlob blob, string diffuseTextureName, string overlayTextureName)
        {
            this.diffuseTextureName = diffuseTextureName;
            this.overlayTextureName = overlayTextureName;

            // blob
            this.width           = blob.width;
            this.height          = blob.height;
            this.edgeSize        = blob.edgeSize;
            this.selectedColor   = blob.selectedColor.ToVector4();
            this.unselectedColor = blob.unselectedColor.ToVector4();
            this.baseColor       = unselectedColor;
            this.ignorePowerOf2  = blob.ignorePowerOf2;

            this.normalMapName = blob.normalMapName;
        }
Beispiel #9
0
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGrid2DExampleElement(ParamBlob blob, ExamplePage example)
        {
            this.example = example;

            // blob
            this.width     = blob.width;
            this.height    = blob.height;
            this.Font      = blob.Font;
            this.textColor = blob.textColor;

            descBlob = new TextBlob(UI2D.Shared.GetGameFont24, example.description.Trim(), 650);
            descBlob.Justification = blob.justify;

            height = 1.1f + descBlob.NumLines * descBlob.TotalSpacing / 96.0f;

            alpha = 0.0f;   // Init to 0 since we're using it for selection.
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridModularCheckboxElement(ParamBlob blob, string label)
        {
            this.label = label;

            // blob
            this.width    = blob.width;
            this.height   = blob.height;
            this.edgeSize = blob.edgeSize;

            this.Font             = blob.Font;
            this.textColor        = blob.textColor;
            this.useDropShadow    = blob.useDropShadow;
            this.invertDropShadow = blob.invertDropShadow;
            this.dropShadowColor  = blob.dropShadowColor;
            this.justify          = blob.justify;

            this.normalMapName = blob.normalMapName;
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridModularPictureListElement(ParamBlob blob, string label)
        {
            this.label = TextHelper.FilterInvalidCharacters(label);

            // blob
            this.width    = blob.width;
            this.height   = blob.height;
            this.edgeSize = blob.edgeSize;

            this.Font             = blob.Font;
            this.textColor        = blob.textColor;
            this.useDropShadow    = blob.useDropShadow;
            this.invertDropShadow = blob.invertDropShadow;
            this.dropShadowColor  = blob.dropShadowColor;
            this.justify          = blob.justify;

            this.normalMapName = blob.normalMapName;
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGrid2DTextureElement(ParamBlob blob, string diffuseTextureName)
        {
            this.diffuseTextureName = diffuseTextureName;

            // blob
            this.width                 = blob.width;
            this.height                = blob.height;
            this.edgeSize              = blob.edgeSize;
            this.selectedColor         = blob.selectedColor.ToVector4();
            this.unselectedColor       = blob.unselectedColor.ToVector4();
            this.baseColor             = unselectedColor;
            this.altShader             = blob.altShader;
            this.altPreMultAlphaShader = blob.altPreMultAlphaShader;
            this.greyFlatShader        = blob.greyFlatShader;
            this.ignorePowerOf2        = blob.ignorePowerOf2;

            this.normalMapName = blob.normalMapName;
            this.elementName   = blob.elementName;
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGrid2DButtonBarElement(ParamBlob blob)
        {
            this.diffuseTextureName = @"GridElements\RadioBoxBlack";

            // blob
            this.width                 = blob.width;
            this.height                = blob.height;
            this.edgeSize              = blob.edgeSize;
            this.selectedColor         = blob.selectedColor.ToVector4();
            this.unselectedColor       = blob.unselectedColor.ToVector4();
            this.baseColor             = unselectedColor;
            this.altShader             = blob.altShader;
            this.altPreMultAlphaShader = blob.altPreMultAlphaShader;
            this.greyFlatShader        = blob.greyFlatShader;
            this.ignorePowerOf2        = blob.ignorePowerOf2;

            this.normalMapName = blob.normalMapName;
            this.elementName   = blob.elementName;
        }
        // c'tor
        public UIGrid2DProgrammedBotElement(ParamBlob blob, ActorHelp actorHelp, int exampleIndex)
        {
            this.actorHelp    = actorHelp;
            this.exampleIndex = exampleIndex;

            // blob
            this.width           = blob.width;
            this.height          = blob.height;
            this.edgeSize        = blob.edgeSize;
            this.selectedColor   = blob.selectedColor.ToVector4();
            this.unselectedColor = blob.unselectedColor.ToVector4();
            this.baseColor       = unselectedColor;

            this.Font             = blob.Font;
            this.textColor        = blob.textColor;
            this.useDropShadow    = blob.useDropShadow;
            this.invertDropShadow = blob.invertDropShadow;
            this.dropShadowColor  = blob.dropShadowColor;
            this.justify          = blob.justify;
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridPictureListElement(ParamBlob blob, string label)
        {
            this.label = label;

            // blob
            this.width           = blob.width;
            this.height          = blob.height;
            this.edgeSize        = blob.edgeSize;
            this.selectedColor   = blob.selectedColor.ToVector4();
            this.unselectedColor = blob.unselectedColor.ToVector4();
            this.baseColor       = unselectedColor;

            this.Font             = blob.Font;
            this.textColor        = blob.textColor;
            this.useDropShadow    = blob.useDropShadow;
            this.invertDropShadow = blob.invertDropShadow;
            this.dropShadowColor  = blob.dropShadowColor;
            this.justify          = blob.justify;

            this.normalMapName = blob.normalMapName;
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridModularRadioBoxElement(ParamBlob blob, string label)
        {
            this.label = label;

            // blob
            this.width    = blob.width;
            this.height   = blob.height;
            this.edgeSize = blob.edgeSize;

            this.Font             = blob.Font;
            this.textColor        = blob.textColor;
            this.useDropShadow    = blob.useDropShadow;
            this.invertDropShadow = blob.invertDropShadow;
            this.dropShadowColor  = blob.dropShadowColor;
            this.justify          = blob.justify;

            this.normalMapName = blob.normalMapName;

            title = label;
            list  = new List <ListEntry>();
        }
Beispiel #17
0
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGrid2DTextElement(ParamBlob blob, string label)
        {
            this.label = TextHelper.FilterInvalidCharacters(label);

            // blob
            this.width           = blob.width;
            this.height          = blob.height;
            this.edgeSize        = blob.edgeSize;
            this.selectedColor   = blob.selectedColor.ToVector4();
            this.unselectedColor = blob.unselectedColor.ToVector4();
            this.baseColor       = unselectedColor;

            this.Font             = blob.Font;
            this.textColor        = blob.textColor;
            this.useDropShadow    = blob.useDropShadow;
            this.invertDropShadow = blob.invertDropShadow;
            this.dropShadowColor  = blob.dropShadowColor;
            this.justify          = blob.justify;

            this.normalMapName = blob.normalMapName;
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridModularButtonElement(ParamBlob blob, string label, string aText, UIButtonElementEvent onA, string xText, UIButtonElementEvent onX)
        {
            this.label       = label;
            this.aButtonText = aText;
            this.xButtonText = xText;
            this.onAButton   = onA;
            this.onXButton   = onX;

            // blob
            this.width    = blob.width;
            this.height   = blob.height;
            this.edgeSize = blob.edgeSize;

            this.Font             = blob.Font;
            this.textColor        = blob.textColor;
            this.useDropShadow    = blob.useDropShadow;
            this.invertDropShadow = blob.invertDropShadow;
            this.dropShadowColor  = blob.dropShadowColor;
            this.justify          = blob.justify;

            this.normalMapName = blob.normalMapName;
        }
        // c'tor
        /// <summary>
        /// Simple c'tor using a blob to hold the common data.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="label"></param>
        public UIGridTextListElement(ParamBlob blob, string label)
        {
            this.label = label;

            // blob
            this.width           = blob.width;
            this.height          = blob.height;
            this.edgeSize        = blob.edgeSize;
            this.selectedColor   = blob.selectedColor.ToVector4();
            this.unselectedColor = blob.unselectedColor.ToVector4();
            this.baseColor       = unselectedColor;

            this.Font             = blob.Font;
            this.textColor        = blob.textColor;
            this.useDropShadow    = blob.useDropShadow;
            this.invertDropShadow = blob.invertDropShadow;
            this.dropShadowColor  = blob.dropShadowColor;
            this.justify          = blob.justify;

            this.normalMapName = blob.normalMapName;

            title    = new TextLine(this, label, Font, false);
            textList = new List <TextLine>();
        }
Beispiel #20
0
        }   // end of UIGrid2DBrushElement c'tor

        /// <summary>
        /// C'tor
        /// </summary>
        /// <param name="blob">Standard paramters for element.</param>
        /// <param name="diffuseTextureName">Resource name for brush texture.</param>
        /// <param name="overlayTextureName">Resource name for overlay texture.</param>
        /// <param name="brushIndex">Index for brush.</param>
        public UIGrid2DBrushElement(ParamBlob blob, string diffuseTextureName, string overlayTextureName, int brushIndex)
            : base(blob, diffuseTextureName, overlayTextureName)
        {
            this.brushIndex = brushIndex;
        } // end of UIGrid2DBrushElement c'tor
 // c'tor
 /// <summary>
 /// Simple c'tor using a blob to hold the common data.
 /// </summary>
 /// <param name="blob"></param>
 /// <param name="label"></param>
 public UIGridFloatSliderElement(ParamBlob blob, string label)
     : base(blob, label)
 {
 }
Beispiel #22
0
 // c'tor
 /// <summary>
 /// Simple c'tor using a blob to hold the common data.
 /// </summary>
 /// <param name="blob"></param>
 /// <param name="label"></param>
 public UIGridModularIntegerSliderElement(ParamBlob blob, string label)
     : base(blob, label)
 {
 }