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
Editor
References a sprite editor. At the moment we can access only the active editor using app.editor.
Editor.sprite
local sprite = app.editor.sprite
Returns the sprite in the editor.
Editor.spritePos
local point = app.editor.spritePos
Returns a point of the the mouse position on the sprite, i.e. what pixel is going to be changed if the user clicks the mouse.
Editor.mousePos
local point = app.editor.mousePos
Returns a point indicating the mouse position on the screen.
Editor:askPoint()
app.editor:askPoint{
title=string,
point=initialPoint,
onclick=function(ev) ... end,
onchange=function(ev) ... end,
oncancel=function(ev) ... end,
}
Asks the user to select a pixel/point on the sprite. It's similar to what happens when you choose Edit > New Brush (but in that case you select a rectangle).
title
: Text to show in the context barpoint
: Initial point to highlight (optional)onclick
: Happens when the user clicks (press/release a mouse button) on the canvasonchange
: Happens when the user drags the mouse (press/move mouse/release a mouse button) on the canvasoncancel
: Happens when the user cancels the action (e.g. press the Escape key)
Editor:cancel()
app.editor:cancel()
Cancels the editor:askPoint() action.