示例#1
0
 /// <summary>
 /// Copy constructor. Initializes a new ScaledValue.
 /// </summary>
 /// <param name='source'>
 /// Source to copy.
 /// </param>
 public ScaledValue(ScaledValue source)
 {
     if (source != null) {
         this.scale = source.scale;
         this.value = source.value;
     }
 }
示例#2
0
 /// <summary>
 /// Copy constructor. Initializes a new ScaledValue.
 /// </summary>
 /// <param name='source'>
 /// Source to copy.
 /// </param>
 public ScaledValue(ScaledValue source)
 {
     if (source != null)
     {
         this.scale = source.scale;
         this.value = source.value;
     }
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PixelCrushers.DialogueSystem.UnityGUI.ScaledRect"/> class.
 /// </summary>
 /// <param name='origin'>
 /// Origin point.
 /// </param>
 /// <param name='alignment'>
 /// Alignment corner that's placed on the origin.
 /// </param>
 /// <param name='x'>
 /// The x offset of the alignment corner.
 /// </param>
 /// <param name='y'>
 /// The y offset of the alignment corner.
 /// </param>
 /// <param name='width'>
 /// Width of the rect.
 /// </param>
 /// <param name='height'>
 /// Height of the rect.
 /// </param>
 /// <param name='minPixelWidth'>
 /// Minimum pixel width.
 /// </param>
 /// <param name='minPixelHeight'>
 /// Minimum pixel height.
 /// </param>
 public ScaledRect(ScaledRectAlignment origin, ScaledRectAlignment alignment, ScaledValue x, ScaledValue y,
                   ScaledValue width, ScaledValue height, float minPixelWidth = 0, float minPixelHeight = 0)
 {
     this.origin         = origin;
     this.alignment      = alignment;
     this.x              = x;
     this.y              = y;
     this.width          = width;
     this.height         = height;
     this.minPixelWidth  = minPixelWidth;
     this.minPixelHeight = minPixelHeight;
 }
示例#4
0
 /// <summary>
 /// Copy constructor. Initializes a new ScaledRect.
 /// </summary>
 /// <param name='source'>
 /// Source to copy.
 /// </param>
 public ScaledRect(ScaledRect source)
 {
     if (source != null)
     {
         this.origin         = source.origin;
         this.alignment      = source.alignment;
         this.x              = new ScaledValue(source.x);
         this.y              = new ScaledValue(source.y);
         this.width          = new ScaledValue(source.width);
         this.height         = new ScaledValue(source.height);
         this.minPixelWidth  = source.minPixelWidth;
         this.minPixelHeight = source.minPixelHeight;
     }
 }
示例#5
0
 /// <summary>
 /// Static utility function to build a new ScaledRect at an origin point and with the
 /// specified size.
 /// </summary>
 /// <returns>
 /// The ScaledRect.
 /// </returns>
 /// <param name='origin'>
 /// The origin point; used for origin and alignment.
 /// </param>
 /// <param name='width'>
 /// Width.
 /// </param>
 /// <param name='height'>
 /// Height.
 /// </param>
 /// <param name='minPixelWidth'>
 /// Minimum pixel width. If <c>0</c>, no minimum.
 /// </param>
 /// <param name='minPixelHeight'>
 /// Minimum pixel height. If <c>0</c>, no minimum.
 /// </param>
 public static ScaledRect FromOrigin(ScaledRectAlignment origin, ScaledValue width, ScaledValue height,
                                     float minPixelWidth = 0, float minPixelHeight = 0)
 {
     return(new ScaledRect(origin, origin, ScaledValue.zero, ScaledValue.zero, width, height, minPixelWidth, minPixelHeight));
 }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PixelCrushers.DialogueSystem.UnityGUI.ScaledRect"/> class.
        /// </summary>
        /// <param name='origin'>
        /// Origin point.
        /// </param>
        /// <param name='alignment'>
        /// Alignment corner that's placed on the origin.
        /// </param>
        /// <param name='x'>
        /// The x offset of the alignment corner.
        /// </param>
        /// <param name='y'>
        /// The y offset of the alignment corner.
        /// </param>
        /// <param name='width'>
        /// Width of the rect.
        /// </param>
        /// <param name='height'>
        /// Height of the rect.
        /// </param>
        /// <param name='minPixelWidth'>
        /// Minimum pixel width.
        /// </param>
        /// <param name='minPixelHeight'>
        /// Minimum pixel height.
        /// </param>
        public ScaledRect(ScaledRectAlignment origin, ScaledRectAlignment alignment, ScaledValue x, ScaledValue y, 
			ScaledValue width, ScaledValue height, float minPixelWidth = 0, float minPixelHeight = 0)
        {
            this.origin = origin;
            this.alignment = alignment;
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
            this.minPixelWidth = minPixelWidth;
            this.minPixelHeight = minPixelHeight;
        }
示例#7
0
        /// <summary>
        /// Static utility function to build a new ScaledRect at an origin point and with the 
        /// specified size.
        /// </summary>
        /// <returns>
        /// The ScaledRect.
        /// </returns>
        /// <param name='origin'>
        /// The origin point; used for origin and alignment.
        /// </param>
        /// <param name='width'>
        /// Width.
        /// </param>
        /// <param name='height'>
        /// Height.
        /// </param>
        /// <param name='minPixelWidth'>
        /// Minimum pixel width. If <c>0</c>, no minimum.
        /// </param>
        /// <param name='minPixelHeight'>
        /// Minimum pixel height. If <c>0</c>, no minimum.
        /// </param>
        public static ScaledRect FromOrigin(ScaledRectAlignment origin, ScaledValue width, ScaledValue height,
			float minPixelWidth = 0, float minPixelHeight = 0)
        {
            return new ScaledRect(origin, origin, ScaledValue.zero, ScaledValue.zero, width, height, minPixelWidth, minPixelHeight);
        }
示例#8
0
 /// <summary>
 /// Copy constructor. Initializes a new ScaledRect.
 /// </summary>
 /// <param name='source'>
 /// Source to copy.
 /// </param>
 public ScaledRect(ScaledRect source)
 {
     if (source != null) {
         this.origin = source.origin;
         this.alignment = source.alignment;
         this.x = new ScaledValue(source.x);
         this.y = new ScaledValue(source.y);
         this.width = new ScaledValue(source.width);
         this.height = new ScaledValue(source.height);
         this.minPixelWidth = source.minPixelWidth;
         this.minPixelHeight = source.minPixelHeight;
     }
 }