/// <summary> /// Clones (deep copies) the GUI Mask /// </summary> /// <returns></returns> public override object Clone() { GUIMask ret = new GUIMask(); if (ret == null) { throw new OutOfMemoryException("GUIMask.Clone() failed its allocation."); } // GUIControl level copy ret.ID = this.ID; ret.Parent = this.Parent; ret.Name = this.Name; ret.Layout = this.Layout.Clone() as MaskLayout; ret.Scene = this.Scene; ret.AnchorFlags = this.AnchorFlags; ret.Mask = this.Mask; // GUIMask level copy ret.TextureID = this.TextureID; ret.Skew = this.Skew; ret.Flip = this.Flip; return(ret); }
/// <summary> /// Draws the control /// </summary> public virtual void Draw(Otter.Interface.Graphics graphics) { foreach (GUIControl control in Controls) { if (control.Hidden && control.GetType() != typeof(GUIMask)) { continue; } graphics.PushMatrix(control.Transform.Entries); //check whether we have a mask to render first int inheritedMaskID = control.InheritedMask; if (inheritedMaskID != -1) { GUIMask maskControl = ParentView.Controls.GetControl(inheritedMaskID) as GUIMask; maskControl.DrawMask(Otter.Interface.Graphics.Instance); } control.Draw(graphics); graphics.PopMatrix(); } }
/// <summary> /// Clones (deep copies) the GUI Mask /// </summary> /// <returns></returns> public override object Clone() { GUIMask ret = new GUIMask(); if (ret == null) throw new OutOfMemoryException("GUIMask.Clone() failed its allocation."); // GUIControl level copy ret.ID = this.ID; ret.Parent = this.Parent; ret.Name = this.Name; ret.Layout = this.Layout.Clone() as MaskLayout; ret.Scene = this.Scene; ret.AnchorFlags = this.AnchorFlags; ret.Mask = this.Mask; // GUIMask level copy ret.TextureID = this.TextureID; ret.Skew = this.Skew; ret.Flip = this.Flip; return ret; }