protected override void UpdateDisplayList(float width, float height) { base.UpdateDisplayList(width, height); _border.SetStyle("backgroundStyle", GetStyle("borderStyle")); _border.SetStyle("backgroundColor", GetStyle("borderColor")); }
protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Id = "background", Left = 0, Right = 0, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundColor", ColorMixer.FromHex(0x439dde).ToColor()); AddChild(_background); #endregion #region Content group ContentGroup = new Group { Id = "contentGroup", //Left = 6, //Right = 6, //Top = 50, //Bottom = 50 }; AddChild(ContentGroup); #endregion }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); AddChild(_background); #endregion #region Icon IconDisplay = new Image { HorizontalCenter = 0f, VerticalCenter = 0f, MouseEnabled = false }; AddChild(IconDisplay); #endregion }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, BackgroundColor = (Color)GetStyle("backgroundUpColor") }; _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); AddChild(_background); #endregion VGroup vGroup = new VGroup { Gap = 10, HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle, HorizontalCenter = 0, VerticalCenter = 0, Right = 10, Left = 10, Top = 10, Bottom = 10, }; AddChild(vGroup); #region Icon IconDisplay = new Image { MouseEnabled = false }; vGroup.AddChild(IconDisplay); #endregion #region Label LabelDisplay = new Label { MouseEnabled = false, Multiline = true, Color = (Color)GetStyle("labelUpColor") }; vGroup.AddChild(LabelDisplay); #endregion }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); AddChild(_background); _backgroundImage = new Image { //Id = "background_image", Left = 0, Right = 0, Top = 0, Bottom = 0, Visible = false, Mode = ImageMode.Tiled }; AddChild(_backgroundImage); //_shine = new RectShape //{ // Left = 0, // Right = 0, // Top = 0, // Height = GetCurrentShineHeight(), // MouseEnabled = false //}; //_shine.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); //_shine.Color = (Color) GetStyle("shineColor"); //AddChild(_shine); #endregion #region Icon IconDisplay = new Image { HorizontalCenter = 0f, VerticalCenter = 0f, MouseEnabled = false }; AddChild(IconDisplay); #endregion }
/// <summary> /// /// </summary> /// <param name="width"></param> /// <param name="height"></param> protected override void UpdateDisplayList(float width, float height) { if (null != _background) { _background.SetStyle("backgroundStyle", GetStyle("backgroundStyle")); _background.BackgroundColor = (Color)GetStyle("backgroundColor"); _background.Alpha = (float)GetStyle("backgroundAlpha"); } base.UpdateDisplayList(width, height); }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { //Id = "background", //Color = (Color)GetStyle("backgroundColor"), Left = 0, Right = 24, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundStyle", PopupButtonStyle.Instance); AddChild(_background); #endregion #region Arrow button _background2 = new RectShape { Right = 0, Top = 0, Bottom = 0, Width = 25, Height = 25 }; _background2.SetStyle("backgroundStyle", ArrowButtonStyle.Instance); AddChild(_background2); #endregion //#region Label //LabelDisplay = new Label //{ // HorizontalCenter = 0, // VerticalCenter = 0, // Right = 10, // Left = 10, // Top = 10, // Bottom = 10, // MouseEnabled = false //}; ////LabelDisplay.SetStyle("color", GetStyle("textColor")); //AddChild(LabelDisplay); //#endregion }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundStyle", NumericStepperDecrementButtonStyle.Instance); AddChild(_background); }
protected override void UpdateDisplayList(float width, float height) { //Debug.Log("UpdateDisplayList"); base.UpdateDisplayList(width, height); if (null == _overlayBounds) { return; } Move(_overlayBounds.X, _overlayBounds.Y); // Note: SetActualSize is not a good way // this is because explicit sizes are set during the button configuration time // on the other hand, if we do not set the explicit sizing, the button want to get measured, but having no font defined so there are problems // we don't want it to measure itself anyway, so we are setting the explicit size here //_frame.SetActualSize(_overlayBounds.Width, _overlayBounds.Height); _frame.Width = _overlayBounds.Width; _frame.Height = _overlayBounds.Height; _frame.SetStyle("backgroundStyle", GetStyle("borderStyle")); // ?? InspectorOverlay2PxRectStyle.Instance); _frame.SetStyle("backgroundColor", GetStyle("borderColor")); if (null != _label) { _label.SetStyle("labelStyle", GetStyle("labelStyle"));// InspectorOverlayLabelStyle.Instance); _label.Visible = (bool)GetStyle("showLabel"); _label.ContentColor = (Color)GetStyle("textColor"); _label.SetStyle("font", GetStyle("font")); _label.BackgroundColor = (Color)GetStyle("borderColor"); // just a small calculation on where to place the label float y = _overlayBounds.Height; // draw label below rectangle if (null != _stageBounds && _overlayBounds.Bottom + _label.Height > _stageBounds.Bottom) // rectangle is outside stage bounds { y = 0; // draw label inside rectangle } _label.Move(0, y); _label.SetActualSize(_label.GetExplicitOrMeasuredWidth(), _label.GetExplicitOrMeasuredHeight()); } }
protected override void UpdateDisplayList(float width, float height) { HeaderIconDisplay.Visible = HeaderIconDisplay.IncludeInLayout = null != HeaderIconDisplay.Texture; TitleDisplay.Visible = TitleDisplay.IncludeInLayout = !string.IsNullOrEmpty(TitleDisplay.Text); _labelGroup.Right = ToolGroup.Width + 10; if (null != _background) { _background.Visible = (bool)GetStyle("showBackground"); _background.BackgroundColor = (Color)GetStyle("backgroundColor"); } if (null != _headerBackground) { _headerBackground.Visible = (bool)GetStyle("showHeaderBackground"); _headerBackground.BackgroundColor = (Color)GetStyle("headerBackgroundColor"); } if (null != _contentGroupBackground) { _contentGroupBackground.Visible = (bool)GetStyle("showContentBackground"); _contentGroupBackground.BackgroundColor = (Color)GetStyle("contentBackgroundColor"); } if (null != _controlBarBackground) { _controlBarBackground.Visible = (bool)GetStyle("showControlBarBackground"); _controlBarBackground.BackgroundColor = (Color)GetStyle("controlGroupBackgroundColor"); } if (null != TitleDisplay) { TitleDisplay.SetStyle("labelStyle", GetStyle("headerLabelStyle")); TitleDisplay.SetStyle("color", GetStyle("headerLabelColor")); } if (null != _scroller) { _scroller.SkinClass = EvaluateSkinClassFromStyle("scrollerSkin"); } if (null != _border) { _border.SetStyle("backgroundStyle", GetStyle("borderStyle")); _border.BackgroundColor = (Color)GetStyle("borderColor"); } base.UpdateDisplayList(width, height); }
protected override void UpdateDisplayList(float width, float height) { HeaderIconDisplay.Visible = HeaderIconDisplay.IncludeInLayout = null != HeaderIconDisplay.Texture; TitleDisplay.Visible = TitleDisplay.IncludeInLayout = !string.IsNullOrEmpty(TitleDisplay.Text); _labelGroup.Right = ToolGroup.Width + 10; if (null != _backgroundImage) { _backgroundImage.Visible = (bool)GetStyle("showBackground"); _backgroundImage.Texture = (Texture)GetStyle("backgroundTexture"); _backgroundImage.Mode = (ImageMode)GetStyle("backgroundImageMode"); } if (null != _headerBackgroundImage) { _headerBackgroundImage.Visible = (bool)GetStyle("showHeaderBackground"); _headerBackgroundImage.Texture = (Texture)GetStyle("headerBackgroundTexture"); _headerBackgroundImage.Mode = (ImageMode)GetStyle("headerBackgroundImageMode"); } if (null != _contentGroupBackgroundImage) { _contentGroupBackgroundImage.Visible = (bool)GetStyle("showContentGroupBackground"); _contentGroupBackgroundImage.Texture = (Texture)GetStyle("contentGroupBackgroundTexture"); _contentGroupBackgroundImage.Mode = (ImageMode)GetStyle("contentGroupBackgroundImageMode"); } /*if (null != _controlBarBackgroundImage) * { * _controlBarBackgroundImage.Visible = (bool)GetStyle("showControlBarBackground"); * _controlBarBackgroundImage.Texture = (Texture) GetStyle("controlBarBackgroundTexture"); * _controlBarBackgroundImage.Mode = (ImageMode)GetStyle("controlBarBackgroundImageMode"); * }*/ if (null != TitleDisplay) { TitleDisplay.SetStyle("labelStyle", GetStyle("headerLabelStyle")); TitleDisplay.SetStyle("color", GetStyle("headerLabelColor")); } if (null != _border) { _border.SetStyle("backgroundStyle", GetStyle("borderStyle")); _border.BackgroundColor = (Color)GetStyle("borderColor"); } base.UpdateDisplayList(width, height); }
protected override void UpdateDisplayList(float width, float height) { if (null != _background) { _background.SetStyle("backgroundStyle", GetStyle("backgroundStyle")); _background.BackgroundColor = (Color)GetStyle("backgroundColor"); } if (null != LabelDisplay) { LabelDisplay.SetStyle("color", GetStyle("textColor")); } base.UpdateDisplayList(width, height); }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); AddChild(_background); _backgroundImage = new Image { //Id = "background_image", Left = 1, Right = 1, Top = 1, Bottom = 1, Visible = false, Mode = ImageMode.Tiled, AdjustWidthToTexture = false, AdjustHeightToTexture = false }; AddChild(_backgroundImage); #endregion #region Icon IconDisplay = new Image { HorizontalCenter = 0f, VerticalCenter = 0f, MouseEnabled = false }; AddChild(IconDisplay); #endregion }
protected override void UpdateDisplayList(float width, float height) { if (null != _backgroundImage) { Texture texture = (Texture)GetStyle("backgroundTexture"); if (null != texture) { _backgroundImage.Texture = texture; _backgroundImage.Visible = true; } } if (null != _background) { _background.Visible = (bool)GetStyle("showBackground"); _background.BackgroundColor = (Color)GetStyle("backgroundColor"); } if (null != _headerBackground) { _headerBackground.Visible = (bool)GetStyle("showHeaderBackground"); _headerBackground.BackgroundColor = (Color)GetStyle("headerBackgroundColor"); } if (null != _controlBarBackground) { _controlBarBackground.Visible = (bool)GetStyle("showControlBarBackground"); _controlBarBackground.BackgroundColor = (Color)GetStyle("controlGroupBackgroundColor"); } if (null != TitleDisplay) { TitleDisplay.SetStyle("labelStyle", GetStyle("headerLabelStyle")); TitleDisplay.SetStyle("color", GetStyle("headerLabelColor")); } if (null != _border) { _border.SetStyle("backgroundStyle", GetStyle("borderStyle")); _border.BackgroundColor = (Color)GetStyle("borderColor"); } base.UpdateDisplayList(width, height); }
/*public override void StyleChanged(string styleProp) * { * base.StyleChanged(styleProp); * * if (styleProp == "backgroundColor") * { * Debug.Log("Skin, backgroundColor: " + GetStyle("backgroundColor")); * Debug.Log("InheritingStyles: " + InheritingStyles); * Debug.Log("NonInheritingStyles: " + NonInheritingStyles); * } * }*/ protected override void UpdateDisplayList(float width, float height) { //Debug.Log("ButtonSkin backgroundColor: " + GetStyle("backgroundColor")); //Debug.Log("Inheriting? : " + StyleManager.Instance.InheritingStyles.Contains("backgroundStyle")); //Debug.Log("Inheriting: " + InheritingStyles.GetValue("backgroundStyle")); //Debug.Log("NonInheritingStyles: " + NonInheritingStyles.GetValue("backgroundStyle")); //Debug.Log("ButtonSkin backgroundStyle: " + GetStyle("backgroundStyle")); if (null != _background) { _background.SetStyle("backgroundStyle", GetStyle("backgroundStyle")); // ButtonStyle.Instance); _background.BackgroundColor = (Color)GetStyle("backgroundColor"); } if (null != LabelDisplay) { LabelDisplay.SetStyle("labelStyle", GetStyle("labelStyle")); LabelDisplay.SetStyle("color", GetStyle("textColor")); } base.UpdateDisplayList(width, height); }
protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundStyle", GetStyle("backgroundStyle")); AddChild(_background); #endregion _group = new Group { Left = 0, Right = 0, Top = 0, Bottom = 0, Layout = GetLayout((bool)GetStyle("vertical")) }; AddChild(_group); #region Icon IconDisplay = new Image { MouseEnabled = false }; _group.AddChild(IconDisplay); #endregion #region Label LabelDisplay = new Label(); _group.AddChild(LabelDisplay); #endregion }
protected override void UpdateDisplayList(float width, float height) { if (null != _background) { _background.SetStyle("backgroundStyle", GetStyle("backgroundStyle")); // ButtonStyle.Instance); _background.BackgroundColor = (Color)GetStyle("backgroundColor"); _background.Alpha = (float)GetStyle("backgroundAlpha"); } if (null != _box) { _box.Visible = (bool)GetStyle("boxShowBackground"); _box.SetStyle("backgroundStyle", GetStyle("boxBackgroundStyle")); } if (null != LabelDisplay) { LabelDisplay.SetStyle("labelStyle", GetStyle("labelStyle")); LabelDisplay.Color = (Color)GetStyle("textColor"); } base.UpdateDisplayList(width, height); }
protected override void UpdateDisplayList(float width, float height) { _background.SetStyle("backgroundStyle", GetStyle("backgroundStyle")); base.UpdateDisplayList(width, height); }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Id = "background", Left = 0, Right = 0, Top = 0, Bottom = 0 }; AddChild(_background); #endregion #region Scroller _scroller = new Scroller { Id = "scroller", SkinClass = EvaluateSkinClassFromStyle("scrollerSkin"), Left = 0, Right = 0, Top = 0, Bottom = 0, MinViewportInset = 1, HasFocusableChildren = false }; AddChild(_scroller); #endregion #region Data group DataGroup = new DataGroup { Id = "data_group", ItemRenderer = new ItemRendererFactory <DefaultItemRenderer>(), Layout = new VerticalLayout { Gap = 0, HorizontalAlign = HorizontalAlign.ContentJustify, RequestedMinRowCount = 5 } }; //AddChild(DataGroup); _scroller.Viewport = DataGroup; #region Border _border = new RectShape { Id = "border", Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = false }; _border.SetStyle("backgroundStyle", OnePxBorderStyle.Instance); _border.SetStyle("backgroundColor", Color.gray); AddChild(_border); #endregion #endregion }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, BackgroundColor = (Color)GetStyle("backgroundColor") }; _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); AddChild(_background); /*_backgroundImage = new Image * { * Left = 0, * Right = 0, * Top = 0, * Bottom = 0, * //Visible = false, * ScaleMode = ImageScaleMode.ScaleToFill * }; * AddChild(_backgroundImage);*/ #endregion VGroup vGroup = new VGroup { Gap = 10, HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle, HorizontalCenter = 0, VerticalCenter = 0, Right = 10, Left = 10, Top = 10, Bottom = 10, }; AddChild(vGroup); #region Icon IconDisplay = new Image { MouseEnabled = false, //Visible = false, //IncludeInLayout = false }; vGroup.AddChild(IconDisplay); #endregion #region Label LabelDisplay = new Label { MouseEnabled = false, //Visible = false, //IncludeInLayout = false }; vGroup.AddChild(LabelDisplay); #endregion }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, Alpha = 0.5f }; //_background.SetStyle("backgroundStyle", ButtonStyle.Instance); AddChild(_background); #endregion #region Box Group box = new Group { HorizontalCenter = 0, VerticalCenter = 0 }; AddChild(box); _boxBg = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, HorizontalCenter = 0, VerticalCenter = 0, /*MinWidth = 300, * MinHeight = 100*/ }; //_background.SetStyle("backgroundStyle", ButtonStyle.Instance); _background.SetStyle("backgroundColor", Color.blue); box.AddChild(_boxBg); #endregion HGroup hGroup = new HGroup { Left = 10, Right = 10, Top = 10, Bottom = 10, HorizontalCenter = 0, VerticalCenter = 0, VerticalAlign = VerticalAlign.Middle }; box.AddChild(hGroup); #region Icon IconDisplay = new Image { MouseEnabled = false }; hGroup.AddChild(IconDisplay); #endregion #region Label LabelDisplay = new Label { Text = "miki", MouseEnabled = false, //Width = 100 }; hGroup.AddChild(LabelDisplay); #endregion }