Dimension

Methods
4
Fields
2

Getting one

Dimension.new(…)
client:getRealDimensions()
client:getStretchedDimensions()

Methods

MethodReturnsDescription
getWidth()numberThe width.
getHeight()numberThe height.
equals(any)booleanWhether other is a Dimension of the same width and height; false for anything else. == is identity: the same object.
new(number, number)Dimension(number, number) -> Dimension: A width by height size.
new()Dimension

Fields

FieldTypeDescription
widthnumberThe width, a public field: writable (d.width = 5), and seen by every holder of this object.
heightnumberThe height, a public field: writable (d.height = 5), and seen by every holder of this object.

Returned by

MethodReturnsDescription
Client.getRealDimensionsDimensionThe canvas size: the window over the client's own UI scale (its "UiScaling" setting), raised to keep 765 × 503 at the window's aspect. Whil…
Client.getStretchedDimensionsDimensionThe size the canvas is drawn at, in the units a plugin sees: the canvas size, as getRealDimensions(). The client stretches its canvas to…
Component.getMaximumSizeDimensionThe maximum size (the native member).
Component.getMinimumSizeDimensionThe minimum size (the native member).
Component.getPreferredSizeDimensionThe preferred size: the size set with setPreferredSize, else the look's or the layout's, else Component's default. The native member: a…
Component.getSizeDimensionThe size, as a new Dimension.
DimensionClass.newDimension(number, number) -> Dimension: A width by height size.
JViewport.getExtentSizeDimensionThe visible part's size.
Overlay.getPreferredSizeDimension?The preferred size, or nil: the very Dimension given to setPreferredSize, until the user resizes or resets the overlay; then the one th…
Overlay.renderDimension?Draws the overlay with graphics (translated to the overlay's location, in the font its position calls for) and answers its size, or nil.…
PanelComponent.getPreferredSizeDimension?getPreferredSize().
Rectangle.getSizeDimensionThe size, as a new Dimension.
RenderableEntity.renderDimension?render(graphics): draw on graphics and answer the size drawn, or nil. An exception the component throws is a Luau error with its mess…

Method details

equals

equals: (Dimension, any) -> boolean

Whether other is a Dimension of the same width and height; false for anything else. == is identity: the same object.

new

new: ((number, number) -> Dimension) & (() -> Dimension)

(number, number) -> Dimension: A width by height size.

() -> Dimension: A zero size.