Feedback
- press ENTER to search or ESC to cancel
Table of content
Globals namespaces
Constants
- Align
- AniDir
- BlendMode
- BrushPattern
- BrushType
- ColorMode
- FilterChannels
- Ink
- MouseButton
- MouseCursor
- RangeType
- SelectionMode
- SpriteSheetDataFormat
- SpriteSheetType
- WebSocketMessageType
Classes/objects
- Brush
- Cel
- Color
- ColorSpace
- Dialog
- Editor
- Events
- Frame
- GraphicsContext
- Image
- ImageSpec
- KeyEvent
- Layer
- MouseEvent
- Palette
- Plugin
- Point
- Properties
- Range
- Rectangle
- Selection
- Site
- Size
- Slice
- Sprite
- Tag
- Tile
- Tileset
- Timer
- Tool
- TouchEvent
- Version
- WebSocket
- Window
Size
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()
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).
Size.width
local width = size.width
size.width = newWidth
Size.height
local height = size.height
size.height = newHeight
Size.w
Same as Size.width.
Size.h
Same as Size.height.
Size:union()
local newSize = size:union(otherSize)
Returns the new size newSize
which will be big enough to contains
both given dimensions (size
and otherSize
).