Skip to content

RectExtensionMethods

interludesoftware.tick

Interlude.Tick

RectExtensionMethods Class

public static class RectExtensionMethods

Inheritance System.Object → RectExtensionMethods

Methods

RectExtensionMethods.Bottom(this Rect, Size) Method

Returns a sub-rect taken from the bottom of rect with the height given by s. Negative values measure from the top.

public static Rect Bottom(this Rect rect, Interlude.Tick.Size s);

Parameters

rect UnityEngine.Rect

s Size

Returns

UnityEngine.Rect

RectExtensionMethods.BottomHalf(this Rect) Method

Returns the bottom 50% of rect.

public static Rect BottomHalf(this Rect rect);

Parameters

rect UnityEngine.Rect

Returns

UnityEngine.Rect

RectExtensionMethods.Center(this Rect, Size) Method

Returns a square rect of the given size centred within rect.

public static Rect Center(this Rect rect, Interlude.Tick.Size size);

Parameters

rect UnityEngine.Rect

size Size

Returns

UnityEngine.Rect

RectExtensionMethods.Center(this Rect, Size, Size) Method

Returns a rect of the given width and height centred within rect.

public static Rect Center(this Rect rect, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.CenterHorizontal(this Rect, Size) Method

Returns a rect of the given width centred horizontally within rect.

public static Rect CenterHorizontal(this Rect rect, Interlude.Tick.Size width);

Parameters

rect UnityEngine.Rect

width Size

Returns

UnityEngine.Rect

RectExtensionMethods.CenterVertical(this Rect, Size) Method

Returns a rect of the given height centred vertically within rect.

public static Rect CenterVertical(this Rect rect, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.EnsureValidDims(this Rect) Method

Returns a copy of rect with width and height forced to non-negative values, adjusting the origin accordingly.

public static Rect EnsureValidDims(this Rect rect);

Parameters

rect UnityEngine.Rect

Returns

UnityEngine.Rect

RectExtensionMethods.Expand(this Rect, int) Method

Expands all four sides of rect by pixels.

public static Rect Expand(this Rect rect, int pixels);

Parameters

rect UnityEngine.Rect

pixels System.Int32

Returns

UnityEngine.Rect

RectExtensionMethods.InsetBottom(this Rect, Size, Size, Size) Method

Returns a fixed-size rect horizontally centred and anchored to the bottom edge of rect, offset inward by offsetY.

public static Rect InsetBottom(this Rect rect, Interlude.Tick.Size offsetY, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

offsetY Size

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.InsetBottomLeft(this Rect, Size, Size, Size, Size) Method

Returns a fixed-size rect anchored to the bottom-left corner of rect, offset inward by offsetX and offsetY.

public static Rect InsetBottomLeft(this Rect rect, Interlude.Tick.Size offsetX, Interlude.Tick.Size offsetY, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

offsetX Size

offsetY Size

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.InsetBottomRight(this Rect, Size, Size, Size, Size) Method

Returns a fixed-size rect anchored to the bottom-right corner of rect, offset inward by offsetX and offsetY.

public static Rect InsetBottomRight(this Rect rect, Interlude.Tick.Size offsetX, Interlude.Tick.Size offsetY, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

offsetX Size

offsetY Size

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.InsetLeft(this Rect, Size, Size, Size) Method

Returns a fixed-size rect vertically centred and anchored to the left edge of rect, offset inward by offsetX.

public static Rect InsetLeft(this Rect rect, Interlude.Tick.Size offsetX, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

offsetX Size

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.InsetRight(this Rect, Size, Size, Size) Method

Returns a fixed-size rect vertically centred and anchored to the right edge of rect, offset inward by offsetX.

public static Rect InsetRight(this Rect rect, Interlude.Tick.Size offsetX, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

offsetX Size

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.InsetTop(this Rect, Size, Size, Size) Method

Returns a fixed-size rect horizontally centred and anchored to the top edge of rect, offset inward by offsetY.

public static Rect InsetTop(this Rect rect, Interlude.Tick.Size offsetY, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

offsetY Size

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.InsetTopLeft(this Rect, Size, Size, Size, Size) Method

Returns a fixed-size rect anchored to the top-left corner of rect, offset inward by offsetX and offsetY.

public static Rect InsetTopLeft(this Rect rect, Interlude.Tick.Size offsetX, Interlude.Tick.Size offsetY, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

offsetX Size

offsetY Size

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.InsetTopRight(this Rect, Size, Size, Size, Size) Method

Returns a fixed-size rect anchored to the top-right corner of rect, offset inward by offsetX and offsetY.

public static Rect InsetTopRight(this Rect rect, Interlude.Tick.Size offsetX, Interlude.Tick.Size offsetY, Interlude.Tick.Size width, Interlude.Tick.Size height);

Parameters

rect UnityEngine.Rect

offsetX Size

offsetY Size

width Size

height Size

Returns

UnityEngine.Rect

RectExtensionMethods.Left(this Rect, Size) Method

Returns a sub-rect taken from the left of rect with the width given by s. Negative values measure from the right.

public static Rect Left(this Rect rect, Interlude.Tick.Size s);

Parameters

rect UnityEngine.Rect

s Size

Returns

UnityEngine.Rect

RectExtensionMethods.LeftHalf(this Rect) Method

Returns the left 50% of rect.

public static Rect LeftHalf(this Rect rect);

Parameters

rect UnityEngine.Rect

Returns

UnityEngine.Rect

RectExtensionMethods.Pad(this Rect, float, float, float, float) Method

Shrinks rect by the specified per-side pixel amounts.

public static Rect Pad(this Rect rect, float left, float top, float right, float bottom);

Parameters

rect UnityEngine.Rect

left System.Single

top System.Single

right System.Single

bottom System.Single

Returns

UnityEngine.Rect

RectExtensionMethods.Pad(this Rect, int) Method

Shrinks all four sides of rect by pixels.

public static Rect Pad(this Rect rect, int pixels);

Parameters

rect UnityEngine.Rect

pixels System.Int32

Returns

UnityEngine.Rect

RectExtensionMethods.Pad(this Rect, Margin) Method

Shrinks rect by the amounts specified in margin.

public static Rect Pad(this Rect rect, Interlude.Tick.Margin margin);

Parameters

rect UnityEngine.Rect

margin Margin

Returns

UnityEngine.Rect

RectExtensionMethods.Pad(this Rect, Size, Size, Size, Size) Method

Shrinks rect by the specified per-side Size amounts (pixel or percent).

public static Rect Pad(this Rect rect, Interlude.Tick.Size left, Interlude.Tick.Size top, Interlude.Tick.Size right, Interlude.Tick.Size bottom);

Parameters

rect UnityEngine.Rect

left Size

top Size

right Size

bottom Size

Returns

UnityEngine.Rect

RectExtensionMethods.PadBottom(this Rect, float) Method

Shrinks rect from the bottom by pixels.

public static Rect PadBottom(this Rect rect, float pixels);

Parameters

rect UnityEngine.Rect

pixels System.Single

Returns

UnityEngine.Rect

RectExtensionMethods.PadBottom(this Rect, Size) Method

Shrinks rect from the bottom by size.

public static Rect PadBottom(this Rect rect, Interlude.Tick.Size size);

Parameters

rect UnityEngine.Rect

size Size

Returns

UnityEngine.Rect

RectExtensionMethods.PadHorizontal(this Rect, float) Method

Shrinks rect on the left and right by pixels each.

public static Rect PadHorizontal(this Rect rect, float pixels);

Parameters

rect UnityEngine.Rect

pixels System.Single

Returns

UnityEngine.Rect

RectExtensionMethods.PadHorizontal(this Rect, Size) Method

Shrinks rect on the left and right by size each.

public static Rect PadHorizontal(this Rect rect, Interlude.Tick.Size size);

Parameters

rect UnityEngine.Rect

size Size

Returns

UnityEngine.Rect

RectExtensionMethods.PadLeft(this Rect, float) Method

Shrinks rect from the left by pixels.

public static Rect PadLeft(this Rect rect, float pixels);

Parameters

rect UnityEngine.Rect

pixels System.Single

Returns

UnityEngine.Rect

RectExtensionMethods.PadLeft(this Rect, Size) Method

Shrinks rect from the left by size.

public static Rect PadLeft(this Rect rect, Interlude.Tick.Size size);

Parameters

rect UnityEngine.Rect

size Size

Returns

UnityEngine.Rect

RectExtensionMethods.PadRight(this Rect, float) Method

Shrinks rect from the right by pixels.

public static Rect PadRight(this Rect rect, float pixels);

Parameters

rect UnityEngine.Rect

pixels System.Single

Returns

UnityEngine.Rect

RectExtensionMethods.PadRight(this Rect, Size) Method

Shrinks rect from the right by size.

public static Rect PadRight(this Rect rect, Interlude.Tick.Size size);

Parameters

rect UnityEngine.Rect

size Size

Returns

UnityEngine.Rect

RectExtensionMethods.PadTop(this Rect, float) Method

Shrinks rect from the top by pixels.

public static Rect PadTop(this Rect rect, float pixels);

Parameters

rect UnityEngine.Rect

pixels System.Single

Returns

UnityEngine.Rect

RectExtensionMethods.PadTop(this Rect, Size) Method

Shrinks rect from the top by size.

public static Rect PadTop(this Rect rect, Interlude.Tick.Size size);

Parameters

rect UnityEngine.Rect

size Size

Returns

UnityEngine.Rect

RectExtensionMethods.PadVertical(this Rect, float) Method

Shrinks rect on the top and bottom by pixels each.

public static Rect PadVertical(this Rect rect, float pixels);

Parameters

rect UnityEngine.Rect

pixels System.Single

Returns

UnityEngine.Rect

RectExtensionMethods.PadVertical(this Rect, Size) Method

Shrinks rect on the top and bottom by size each.

public static Rect PadVertical(this Rect rect, Interlude.Tick.Size size);

Parameters

rect UnityEngine.Rect

size Size

Returns

UnityEngine.Rect

RectExtensionMethods.RectCenteredAtPoint(this Rect, Vector2, Vector2) Method

Returns a rect of the given size centred at point.

public static Rect RectCenteredAtPoint(this Rect rect, Vector2 point, Vector2 size);

Parameters

rect UnityEngine.Rect

point UnityEngine.Vector2

size UnityEngine.Vector2

Returns

UnityEngine.Rect

RectExtensionMethods.Right(this Rect, Size) Method

Returns a sub-rect taken from the right of rect with the width given by s. Negative values measure from the left.

public static Rect Right(this Rect rect, Interlude.Tick.Size s);

Parameters

rect UnityEngine.Rect

s Size

Returns

UnityEngine.Rect

RectExtensionMethods.RightHalf(this Rect) Method

Returns the right 50% of rect.

public static Rect RightHalf(this Rect rect);

Parameters

rect UnityEngine.Rect

Returns

UnityEngine.Rect

RectExtensionMethods.Top(this Rect, Size) Method

Returns a sub-rect taken from the top of rect with the height given by s. Negative values measure from the bottom.

public static Rect Top(this Rect rect, Interlude.Tick.Size s);

Parameters

rect UnityEngine.Rect

s Size

Returns

UnityEngine.Rect

RectExtensionMethods.TopHalf(this Rect) Method

Returns the top 50% of rect.

public static Rect TopHalf(this Rect rect);

Parameters

rect UnityEngine.Rect

Returns

UnityEngine.Rect