- 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
ImageSpec
It's a simple object that contains some specifications to create new sprites or images, or to get the information (specs) of a sprite or image, like the canvas size (width/height), color mode, and color space. Often abbreviated as 'spec' in the API.
ImageSpec()
ImageSpec()
ImageSpec(otherImageSpec)
ImageSpec{
width=number,
height=number,
colorMode=number,
transparentColor=number }
Creates a new ImageSpec
instance.
When no arguments are given, defaults to a width and height of 1, with the transparent color index set to zero and RGB color mode.
ImageSpec.colorMode
local colorMode = spec.colorMode
spec.colorMode = colorMode
Gets or sets the color mode of the image or sprite.
ImageSpec.width
local w = spec.width
spec.width = w
Gets or sets the width of the image or sprite.
ImageSpec.height
local h = spec.height
spec.height = h
Gets or sets the height of the image or sprite.
ImageSpec.colorSpace
local colorSpace = spec.colorSpace
spec.colorSpace = ColorSpace{ sRGB=true }
Gets or sets the color space for an image or sprite.
ImageSpec.transparentColor
local mask = spec.transparentColor
spec.transparentColor = mask
Gets or sets the index that refers a transparent color in a palette when the image or sprite uses indexed color mode.