Skip to content

Position


Members

h

desc: The height of the square spanning the down from the top left corner consisting of GridGUI.Position.x and GridGUI.Position.y.

type: number

default: 0

w

desc: The width of the square spanning to the right of the top left corner consisting of GridGUI.Position.x and GridGUI.Position.y.

type: number

default: 0

x

desc: The x coordinate of the position, if the optional GridGUI.Position.w and GridGUI.Position.h are non zero then GridGUI.Position.x is the x coordinate of the top left corner of the square spanning GridGUI.Position.w and GridGUI.Position.h down towards the right.

type: number

y

desc: The y coordinate of the position, if the optional GridGUI.Position.w and GridGUI.Position.h are non zero then GridGUI.Position.y is the y coordinate of the top left corner of the square spanning GridGUI.Position.w and GridGUI.Position.h down towards the right.

type: number

Methods

__CompareX

__CompareX(pos)

Compares the relative position along the x-axis with another GridGUI.Position.

parameters

name: pos

desc: The GridGUI.Position to compare with.

type: GridGUI.Position

return value

desc: Positive values are the amount of overlap, negative values are the distance and zero mean that the ranges are touching.

type: number

__CompareY

__CompareY(pos)

Compares the relative position along the y-axis with another GridGUI.Position.

parameters

name: pos

desc: The GridGUI.Position to compare with.

type: GridGUI.Position

return value

desc: Positive values are the amount of overlap, negative values are the distance and zero mean that the ranges are touching.

type: number

__New

__New(x, y, w := 0, h := 0)

Constructor.

parameters

name: x

desc: The x coordinate of the position, if the optional GridGUI.Position.w and GridGUI.Position.h are non zero then GridGUI.Position.x is the x coordinate of the top left corner of the square spanning GridGUI.Position.w and GridGUI.Position.h down towards the right.

type: string|number|object

name: y

desc: The y coordinate of the position, if the optional GridGUI.Position.w and GridGUI.Position.h are non zero then GridGUI.Position.y is the y coordinate of the top left corner of the square spanning GridGUI.Position.w and GridGUI.Position.h down towards the right.

type: string|number|object

name: w

desc: The width of the square spanning to the right of the top left corner consisting of GridGUI.Position.x and GridGUI.Position.y.

type: number

default: 0

name: h

desc: The height of the square spanning the down from the top left corner consisting of GridGUI.Position.x and GridGUI.Position.y.

type: number

default: 0

return value

desc: A new GridGUI.Position instance.

type: GridGUI.Position

__OneDimentionalCompare

__OneDimentionalCompare(min1, max1, min2, max2)

Compares the amount of overlap between two ranges.

parameters

name: min1

desc: The minimum of the first range.

type: number

name: max1

desc: The maximum of the first range.

type: number

name: min2

desc: The minimum of the second range.

type: number

name: max2

desc: The maximum of the second range.

type: number

return value

desc: Positive values are the amount of overlap, negative values are the distance and zero mean that the ranges are touching.

type: number

__OverlapX

__OverlapX(pos)

Compares the amount of overlap along the x-axis with another GridGUI.Position.

parameters

name: pos

desc: The GridGUI.Position to compare with.

type: GridGUI.Position

return value

desc: The amount of overlap.

type: number

__OverlapY

__OverlapY(pos)

Compares the amount of overlap along the y-axis with another GridGUI.Position.

parameters

name: pos

desc: The GridGUI.Position to compare with.

type: GridGUI.Position

return value

desc: The amount of overlap.

type: number

Area

Area()

Calculates the area of the square with sides GridGUI.Position.w and GridGUI.Position.h.

return value

desc: The area.

type: number

Compare

Compare(pos)

Compares the relative position along the x-axis and the y-axis with another GridGUI.Position.

parameters

name: pos

desc: The GridGUI.Position to compare with.

type: GridGUI.Position

return value

desc: An array with the result of the two one dimensional comparisons. The result of the x-axis comparison is in index 1 and the result of the y-axis comparison is in index 2.

type: array

Contains

Contains(pos)

Check if a GridGUI.Position is contained within the area of this position.

parameters

name: pos

desc: The GridGUI.Position to perform the check on.

type: GridGUI.Position

return value

desc: Whether or not pos was contained within this position.

type: bool

Copy

Copy()

Copy Constructor.

return value

desc: An identical copy of this position.

type: GridGUI.Position

Disjoint

Disjoint(pos)

Check if a GridGUI.Position does not touch this position.

parameters

name: pos

desc: The GridGUI.Position to perform the check on.

type: GridGUI.Position

return value

desc: Whether or not pos touches this position.

type: bool

Equal

Equal(pos)

Check if a GridGUI.Position is identical to this position.

parameters

name: pos

desc: The GridGUI.Position to compare with.

type: GridGUI.Position

return value

desc: Whether or not pos is identical to this position.

type: bool

Intersect

Intersect(pos)

Check if a GridGUI.Position overlaps with this position, that is that at least one corner of one of the two GridGUI.Position is within the other GridGUI.Position.

parameters

name: pos

desc: The GridGUI.Position to perform the check on.

type: GridGUI.Position

return value

desc: Whether or not pos intersects with this position

type: bool

Middle

Middle()

Calculates the middle of this position.

return value

desc: A new GridGUI.Position instance with GridGUI.Position.x and GridGUI.Position.y being the middle of this position.

type: GridGUI.Position

ToStr

ToStr(indent := "")

Converts the object to a string.

parameters

name: indent

desc: The amount of indentation to add on each line.

type: string

default: ""

return value

desc: A string representing this position.

type: string

Touch

Touch(pos)

Check if a GridGUI.Position touches this position, but does not overlap with it.

parameters

name: pos

desc: The GridGUI.Position to perform the check on.

type: GridGUI.Position

return value

desc: Whether or not pos is touching this position.

type: bool

Back to top