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; } }
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; } } }