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