public override void DrawContents() { base.DrawContents(); if (Image != null) { var origonalTransform = Image.ColorTransform; ColorTransform effectTranform = ColorTransform.Identity; if (IsMouseOver) { effectTranform = ColorTransform.Multiply(new Color(1.3f, 1.3f, 1.2f)); } if (Depressed) { effectTranform = ColorTransform.Multiply(new Color(0.8f, 0.8f, 0.8f)); } if (!Enabled) { effectTranform = ColorTransform.BlackAndWhite; } if (!effectTranform.IsIdentity) { Image.ColorTransform = Image.ColorTransform + effectTranform; } Image.Update(); Image.Draw(); Image.ColorTransform = origonalTransform; } }
public override void Update() { base.Update(); updateFadeout(); Image.Update(); Label.Update(); age += Time.deltaTime; Visible = (age >= 0); }