Exemplo n.º 1
0
 private void updateSprite()
 {
     if (this.selectedSprite != null)
     {
         UISpriteUtility.SetupHorizontalThreePatch(this.selectedSprite, this.Width, this.Height, (float)this.selectedImageNinePatch.Left, (float)this.selectedImageNinePatch.Right);
     }
 }
Exemplo n.º 2
0
 private void UpdateBackgroundSprite()
 {
     if ((this.updateFlags & EditableText.UpdateFlags.Background) == EditableText.UpdateFlags.Background)
     {
         UISpriteUnit unit = this.backgroundSprt.GetUnit(0);
         unit.Width  = this.Width;
         unit.Height = this.Height;
         UISpriteUtility.SetupNinePatch(this.backgroundSprt, this.Width, this.Height, 0f, 0f, this.backgroundNinePatchMargin);
         this.updateFlags &= ~EditableText.UpdateFlags.Background;
     }
 }
Exemplo n.º 3
0
 private void SetupSprite()
 {
     if (this.upperEdgeSprt == null || this.lowerEdgeSprt == null)
     {
         this.upperEdgeSprt = new UISprite(3);
         this.listItemContainer.RootUIElement.AddChildLast(this.upperEdgeSprt);
         this.upperEdgeSprt.Image      = new ImageAsset(SystemImageAsset.ListPanelSeparatorTop);
         this.upperEdgeSprt.ShaderType = ShaderType.Texture;
         this.lowerEdgeSprt            = new UISprite(3);
         this.listItemContainer.RootUIElement.AddChildLast(this.lowerEdgeSprt);
         this.lowerEdgeSprt.Image      = new ImageAsset(SystemImageAsset.ListPanelSeparatorBottom);
         this.lowerEdgeSprt.ShaderType = ShaderType.Texture;
     }
     UISpriteUtility.SetupHorizontalThreePatch(this.upperEdgeSprt, this.listItemContainer.Width, 1f, (float)ListPanelItem.margin.Left, (float)ListPanelItem.margin.Right);
     UISpriteUtility.SetupHorizontalThreePatch(this.lowerEdgeSprt, this.listItemContainer.Width, 1f, (float)ListPanelItem.margin.Left, (float)ListPanelItem.margin.Right);
 }
Exemplo n.º 4
0
 private void updateSprite()
 {
     if (this.bgImageSprt != null && this.bgColorSprt != null)
     {
         this.needUpdateSprite = false;
         if (this.backgroundStyle == DialogBackgroundStyle.Default)
         {
             this.bgColorSprt.Visible = false;
             this.bgImageSprt.Visible = true;
             if (this.defaultImageAsset == null)
             {
                 this.defaultImageAsset = new ImageAsset(SystemImageAsset.DialogBackground);
             }
             this.bgImageSprt.Image = this.defaultImageAsset;
             UISpriteUtility.SetupNinePatch(this.bgImageSprt, this.Width, this.Height, 0f, 0f, AssetManager.GetNinePatchMargin(SystemImageAsset.DialogBackground));
         }
         else
         {
             UISpriteUnit unit = this.bgColorSprt.GetUnit(0);
             unit.Color = this.customBackgroundColor;
             unit.SetSize(this.Width, this.Height);
             this.bgColorSprt.Visible = true;
             if (this.customBackgroundImage == null)
             {
                 this.bgImageSprt.Image   = null;
                 this.bgImageSprt.Visible = false;
             }
             else if (this.customBackgroundImage.Ready)
             {
                 this.bgImageSprt.Image   = this.customBackgroundImage;
                 this.bgImageSprt.Visible = true;
                 UISpriteUtility.SetupNinePatch(this.bgImageSprt, this.Width, this.Height, 0f, 0f, this.customBackgroundNinePatchMargin);
             }
             else
             {
                 this.bgImageSprt.Visible = false;
                 this.needUpdateSprite    = true;
             }
         }
         for (int i = 0; i < this.bgImageSprt.UnitCount; i++)
         {
             UISpriteUnit unit2 = this.bgImageSprt.GetUnit(i);
             unit2.Color = this.backgroundFilterColor;
         }
     }
 }