Exemple #1
0
        /// <summary>
        /// Clones (deep copies) the GUI Label
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            GUILabel ret = new GUILabel();
            if (ret == null)
                throw new OutOfMemoryException("GUILabel.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 LabelLayout;
            ret.Scene = this.Scene;
            ret.AnchorFlags = this.AnchorFlags;
            ret.Mask = this.Mask;

            // GUILabel level copy
            ret.FontID = this.FontID; // sets mFont
            ret.HorizontalAlignment = this.HorizontalAlignment;
            ret.VerticalAlignment = this.VerticalAlignment;
            ret.Text = (string)this.Text.Clone();
            ret.Skew = this.Skew;
            ret.DropShadow = this.DropShadow;
            ret.TextFit = this.TextFit;
            ret.Tracking = this.Tracking;
            ret.Leading = this.Leading;

            return ret;
        }
Exemple #2
0
 /// <summary>
 /// Draws a string to screen
 /// </summary>
 /// <param name="text"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <param name="color"></param>
 /// <param name="halign"></param>
 /// <param name="valign"></param>
 public void Draw(string text, float x, float y, float width, float height, Color color, SizeF scale, HoriAlignment halign, VertAlignment valign, float leading, int tracking, float skewAngle, GUILabel.TextFitMode textFit, int dropShadow, int maskID)
 {
     Otter.Interface.Graphics.Instance.DrawString(mFontID, text, x, y, width, height, color.ToArgb(), scale.Width, scale.Height, (int)halign, (int)valign, leading, tracking, skewAngle, (UInt32)textFit, dropShadow, maskID);
 }