Beispiel #1
0
        public static ProgressBarStyle create(Color knobBeforeColor, Color knobAfterColor)
        {
            var knobBefore = new PrimitiveDrawable(knobBeforeColor);

            knobBefore.minWidth = knobBefore.minHeight = 10;

            var knobAfter = new PrimitiveDrawable(knobAfterColor);

            knobAfter.minWidth = knobAfter.minHeight = 10;

            return(new ProgressBarStyle {
                knobBefore = knobBefore, knobAfter = knobAfter
            });
        }
Beispiel #2
0
        public static ProgressBarStyle createWithKnob(Color backgroundColor, Color knobColor)
        {
            var background = new PrimitiveDrawable(backgroundColor);

            background.minWidth = background.minHeight = 10;

            var knob = new PrimitiveDrawable(knobColor);

            knob.minWidth = knob.minHeight = 20;

            return(new ProgressBarStyle {
                background = background, knob = knob
            });
        }
Beispiel #3
0
        public new static SliderStyle create(Color backgroundColor, Color knobColor)
        {
            var background = new PrimitiveDrawable(backgroundColor);

            background.minWidth = background.minHeight = 10;

            var knob = new PrimitiveDrawable(knobColor);

            knob.minWidth = knob.minHeight = 20;

            return(new SliderStyle {
                background = background, knob = knob
            });
        }
Beispiel #4
0
        public static TextFieldStyle create(Color fontColor, Color cursorColor, Color selectionColor, Color backgroundColor)
        {
            var cursor = new PrimitiveDrawable(cursorColor);

            cursor.minWidth  = 1;
            cursor.leftWidth = 4;

            var background = new PrimitiveDrawable(backgroundColor);

            background.leftWidth    = background.rightWidth = 10f;
            background.bottomHeight = background.topHeight = 5f;

            return(new TextFieldStyle {
                fontColor = fontColor,
                cursor = cursor,
                selection = new PrimitiveDrawable(selectionColor),
                background = background
            });
        }
Beispiel #5
0
        public static TextFieldStyle Create(Color fontColor, Color cursorColor, Color selectionColor, Color backgroundColor)
        {
            var cursor = new PrimitiveDrawable(cursorColor);

            cursor.MinWidth  = 1;
            cursor.LeftWidth = 4;

            var background = new PrimitiveDrawable(backgroundColor);

            background.LeftWidth    = background.RightWidth = 10f;
            background.BottomHeight = background.TopHeight = 5f;

            return(new TextFieldStyle {
                FontColor = fontColor,
                Cursor = cursor,
                Selection = new PrimitiveDrawable(selectionColor),
                Background = background
            });
        }
Beispiel #6
0
        public static TextFieldStyle create( Color fontColor, Color cursorColor, Color selectionColor, Color backgroundColor )
        {
            var cursor = new PrimitiveDrawable( cursorColor );
            cursor.minWidth = 1;
            cursor.leftWidth = 4;

            var background = new PrimitiveDrawable( backgroundColor );
            background.leftWidth = background.rightWidth = 10f;
            background.bottomHeight = background.topHeight = 5f;

            return new TextFieldStyle {
                fontColor = fontColor,
                cursor = cursor,
                selection = new PrimitiveDrawable( selectionColor ),
                background = background
            };
        }
Beispiel #7
0
        /// <summary>
        /// Returns a registered drawable. If no drawable is found but a Sprite/NinePatchSprite exists with the name, then the
        /// appropriate drawable is created and stored in the skin. If name is a color a PrimitiveDrawable will be created and stored.
        /// </summary>
        /// <returns>The drawable.</returns>
        /// <param name="name">Name.</param>
        public IDrawable GetDrawable(string name)
        {
            var drawable = Get <IDrawable>(name);

            if (drawable != null)
            {
                return(drawable);
            }

            // Check for explicit registration of ninepatch, sprite or tiled drawable
            drawable = Get <SpriteDrawable>(name);
            if (drawable != null)
            {
                return(drawable);
            }

            drawable = Get <NinePatchDrawable>(name);
            if (drawable != null)
            {
                return(drawable);
            }

            drawable = Get <TiledDrawable>(name);
            if (drawable != null)
            {
                return(drawable);
            }

            drawable = Get <PrimitiveDrawable>(name);
            if (drawable != null)
            {
                return(drawable);
            }

            // still nothing. check for a NinePatchSprite or a Sprite and create a new drawable if we find one
            var ninePatchSprite = Get <NinePatchSprite>(name);

            if (ninePatchSprite != null)
            {
                drawable = new NinePatchDrawable(ninePatchSprite);
                Add(name, drawable as NinePatchDrawable);
                return(drawable);
            }

            var sprite = Get <Sprite>(name);

            if (sprite != null)
            {
                drawable = new SpriteDrawable(sprite);
                Add(name, drawable as SpriteDrawable);
                return(drawable);
            }

            // finally, we will check if name is a Color and create a PrimitiveDrawable if it is
            if (Has <Color>(name))
            {
                var color = Get <Color>(name);
                drawable = new PrimitiveDrawable(color);
                Add(name, drawable as PrimitiveDrawable);
                return(drawable);
            }

            return(null);
        }
Beispiel #8
0
        /// <summary>
        /// Returns a registered drawable. If no drawable is found but a Subtexture/NinePatchSubtexture exists with the name, then the
        /// appropriate drawable is created and stored in the skin. If name is a color a PrimitiveDrawable will be created and stored.
        /// </summary>
        /// <returns>The drawable.</returns>
        /// <param name="name">Name.</param>
        public IDrawable getDrawable(string name)
        {
            var drawable = get <IDrawable>(name);

            if (drawable != null)
            {
                return(drawable);
            }

            // Check for explicit registration of ninepatch, subtexture or tiled drawable
            drawable = get <SubtextureDrawable>(name);
            if (drawable != null)
            {
                return(drawable);
            }

            drawable = get <NinePatchDrawable>(name);
            if (drawable != null)
            {
                return(drawable);
            }

            drawable = get <TiledDrawable>(name);
            if (drawable != null)
            {
                return(drawable);
            }

            drawable = get <PrimitiveDrawable>(name);
            if (drawable != null)
            {
                return(drawable);
            }

            // still nothing. check for a NinePatchSubtexture or a Subtexture and create a new drawable if we find one
            var ninePatchSubtexture = get <NinePatchSubtexture>(name);

            if (ninePatchSubtexture != null)
            {
                drawable = new NinePatchDrawable(ninePatchSubtexture);
                add <NinePatchDrawable>(name, drawable as NinePatchDrawable);
                return(drawable);
            }

            var subtexture = get <Subtexture>(name);

            if (subtexture != null)
            {
                drawable = new SubtextureDrawable(subtexture);
                add <SubtextureDrawable>(name, drawable as SubtextureDrawable);
                return(drawable);
            }

            // finally, we will check if name is a Color and create a PrimitiveDrawable if it is
            if (has <Color>(name))
            {
                var color = get <Color>(name);
                drawable = new PrimitiveDrawable(color);
                add <PrimitiveDrawable>(name, drawable as PrimitiveDrawable);
                return(drawable);
            }

            return(null);
        }
Beispiel #9
0
		public static ProgressBarStyle createWithKnob( Color backgroundColor, Color knobColor )
		{
			var background = new PrimitiveDrawable( backgroundColor );
			background.minWidth = background.minHeight = 10;

			var knob = new PrimitiveDrawable( knobColor );
			knob.minWidth = knob.minHeight = 20;

			return new ProgressBarStyle {
				background = background,
				knob = knob
			};
		}
Beispiel #10
0
		public static ProgressBarStyle create( Color knobBeforeColor, Color knobAfterColor )
		{
			var knobBefore = new PrimitiveDrawable( knobBeforeColor );
			knobBefore.minWidth = knobBefore.minHeight = 10;

			var knobAfter = new PrimitiveDrawable( knobAfterColor );
			knobAfter.minWidth = knobAfter.minHeight = 10;

			return new ProgressBarStyle {
				knobBefore = knobBefore,
				knobAfter = knobAfter
			};
		}
Beispiel #11
0
		public new static SliderStyle create( Color backgroundColor, Color knobColor )
		{
			var background = new PrimitiveDrawable( backgroundColor );
			background.minWidth = background.minHeight = 10;

			var knob = new PrimitiveDrawable( knobColor );
			knob.minWidth = knob.minHeight = 20;

			return new SliderStyle {
				background = background,
				knob = knob
			};
		}