If a function receives a size as an argument it could be several things:
- You can specify two parameters
width, height
directly as arguments of the function. E.g.sprite:resize(64, 32)
- You can specify an object with
width
andheight
properties. E.g.sprite:resize{ width=64, height=32 }
- You can specify an array two elements:
E.g.
sprite:resize{ 64, 32 }
- You can specify a
Size
instance: E.g.sprite:resize(Size(64, 32))
Size()
Size(otherSize)
Size(width, height)
Size{width=number, height=number}
Size{w=number, h=number}
Size{number, number}
Creates a new Size
instance with the given dimensions (or
width=height=0
if they are not specified).
local width = size.width
size.width = newWidth
local height = size.height
size.height = newHeight
Same as Size.width.
Same as Size.height.
local newSize = size:union(otherSize)
Returns the new size newSize
which will be big enough to contains
both given dimensions (size
and otherSize
).