diff --git a/api/app_command.md b/api/app_command.md index b751b39..97ff522 100644 --- a/api/app_command.md +++ b/api/app_command.md @@ -5,165 +5,267 @@ app.command.CommandName() app.command.CommandName { param1=value1, param2=value2, ... } ``` -Executes the given command named `CommandName` with the given -parameters. +Executes the given command named `CommandName` with the specified parameters. -* app.command.About -* [app.command.AddColor](command/AddColor.md#addcolor) -* app.command.AdvancedMode -* app.command.AutocropSprite +* app.command.About [[UI]](#requiresUI "Requires UI") + * Opens the About Aseprite window +* [app.command.AddColor](command/AddColor.md#addcolor "Adds a new color to the palette.") +* app.command.AdvancedMode [[UI]](#requiresUI "Requires UI") + * Toggles the application's "Advanced Mode" +* [app.command.AutocropSprite](command/AutocropSprite.md#autocropsprite) * app.command.BackgroundFromLayer -* [app.command.BrightnessContrast](command/BrightnessContrast.md#brightnesscontrast) + * Equivalent to using Convert To -> Background in the Layer's context menu +* [app.command.BrightnessContrast](command/BrightnessContrast.md#brightnesscontrast) [[*]](#canHaveUI "Can have UI interaction") * app.command.Cancel -* [app.command.CanvasSize](command/CanvasSize.md#canvassize) -* [app.command.CelOpacity](command/CelOpacity.md#celopacity) -* app.command.CelProperties -* app.command.ChangeBrush -* app.command.ChangeColor -* [app.command.ChangePixelFormat](command/ChangePixelFormat.md#changepixelformat) -* app.command.ClearCel + * Equivalent to pressing the Esc key +* [app.command.CanvasSize](command/CanvasSize.md#canvassize) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.CelOpacity](command/CelOpacity.md#celopacity "Changes the opacity of the active Cel") +* app.command.CelProperties [[UI]](#requiresUI "Requires UI") + * Shows the Properties dialog for the active Cel +* [app.command.ChangeBrush](command/ChangeBrush.md#changebrush "Changes the brush of the active tool") [[UI]](#requiresUI "Requires UI") +* [app.command.ChangeColor](command/ChangeColor.md#changecolor "Changes the current foreground or background color") [[UI]](#requiresUI "Requires UI") +* [app.command.ChangePixelFormat](command/ChangePixelFormat.md#changepixelformat) [[*]](#canHaveUI "Can have UI interaction") * app.command.Clear -* app.command.CloseAllFiles -* app.command.CloseFile -* [app.command.ColorCurve](command/ColorCurve.md#colorcurve) -* app.command.ColorQuantization + * Clear the current active document +* app.command.ClearCel + * Clear the active cel in unlocked layers +* app.command.ClearRecentFiles + * Clear the recent files list +* app.command.CloseAllFiles [[UI]](#requiresUI "Requires UI") + * Close all open files +* app.command.CloseFile [[UI]](#requiresUI "Requires UI") + * Close the active file +* [app.command.ColorCurve](command/ColorCurve.md#colorcurve) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.ColorQuantization](command/ColorQuantization.md#colorquantization "Creates a palette from the current sprite") [[*]](#canHaveUI "Can have UI interaction") * app.command.ContiguousFill -* [app.command.ConvolutionMatrix](command/ConvolutionMatrix.md#convolutionmatrix) -* app.command.CopyCel + * Changes the current tool to Contiguous Fill +* [app.command.ConvolutionMatrix](command/ConvolutionMatrix.md#convolutionmatrix "Select and apply a convolution matrix to the image") [[*]](#canHaveUI "Can have UI interaction") * [app.command.CopyColors](command/CopyColors.md#copycolors) * app.command.CopyMerged + * Copies the active sprite as a merged image to the clipboard * app.command.Copy -* app.command.CropSprite + * Performs a copy command on the current selection +* [app.command.CropSprite](command/CropSprite.md#cropsprite) * app.command.Cut + * Performs a cut command on the current selection * app.command.DeselectMask -* [app.command.Despeckle](command/Despeckle.md#despeckle) -* app.command.DeveloperConsole -* app.command.DiscardBrush + * Deselects the current mask +* [app.command.Despeckle](command/Despeckle.md#despeckle "Applies median blur") [[*]](#canHaveUI "Can have UI interaction") +* app.command.DeveloperConsole [[UI]](#requiresUI "Requires UI") + * Opens the developer console (experimental) +* app.command.DiscardBrush [[UI]](#requiresUI "Requires UI") + * Discard the active brush * app.command.DuplicateLayer -* app.command.DuplicateSprite -* app.command.DuplicateView -* app.command.Exit -* [app.command.ExportSpriteSheet](command/ExportSpriteSheet.md#exportspritesheet) -* [app.command.ExportTileset](command/ExportTileset.md#exporttileset) + * Duplicate the currently selected layer +* [app.command.DuplicateSprite](command/DuplicateSprite.md#duplicatesprite) [[*]](#canHaveUI "Can have UI interaction") +* app.command.DuplicateView [[UI]](#requiresUI "Requires UI") + * Duplicates the current workspace view +* app.command.Exit [[UI]](#requiresUI "Requires UI") + * Instructs Aseprite to exit, the user will be prompted to save if any files are modified and it can be canceled +* [app.command.ExportSpriteSheet](command/ExportSpriteSheet.md#exportspritesheet) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.ExportTileset](command/ExportTileset.md#exporttileset) [[*]](#canHaveUI "Can have UI interaction") * app.command.Eyedropper + * Grabs the color under the current mouse position with the Eyedropper tool * app.command.Fill -* app.command.FitScreen -* app.command.FlattenLayers -* app.command.Flip -* app.command.FrameProperties -* app.command.FrameTagProperties -* app.command.FullscreenPreview -* app.command.GotoFirstFrameInTag -* app.command.GotoFirstFrame -* app.command.GotoFrame -* app.command.GotoLastFrameInTag -* app.command.GotoLastFrame -* app.command.GotoNextFrameWithSameTag -* app.command.GotoNextFrame -* app.command.GotoNextLayer -* app.command.GotoNextTab -* app.command.GotoPreviousFrameWithSameTag -* app.command.GotoPreviousFrame -* app.command.GotoPreviousLayer -* app.command.GotoPreviousTab -* app.command.GridSettings -* app.command.Home -* [app.command.HueSaturation](command/HueSaturation.md#huesaturation) -* [app.command.ImportSpriteSheet](command/ImportSpriteSheet.md#importspritesheet) -* [app.command.InvertColor](command/InvertColor.md#invertcolor) + * Performs a foreground color fill on the current selection mask +* app.command.FitScreen [[UI]](#requiresUI "Requires UI") + * Resets the zoom on the current view to fit the screen +* [app.command.FlattenLayers](command/FlattenLayers.md#flattenlayers) +* [app.command.Flip](command/Flip.md#flip) +* [app.command.FrameProperties](command/FrameProperties.md#frameproperties) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.FrameTagProperties](command/FrameTagProperties.md#frametagproperties) [[*]](#canHaveUI "Can have UI interaction") +* app.command.FullscreenPreview [[UI]](#requiresUI "Requires UI") + * Opens the full screen preview +* app.command.GotoFirstFrameInTag [[UI]](#requiresUI "Requires UI") +* app.command.GotoFirstFrame [[UI]](#requiresUI "Requires UI") +* app.command.GotoFrame [[UI]](#requiresUI "Requires UI") +* app.command.GotoLastFrameInTag [[UI]](#requiresUI "Requires UI") +* app.command.GotoLastFrame [[UI]](#requiresUI "Requires UI") +* app.command.GotoNextFrameWithSameTag [[UI]](#requiresUI "Requires UI") +* app.command.GotoNextFrame [[UI]](#requiresUI "Requires UI") +* app.command.GotoNextLayer [[UI]](#requiresUI "Requires UI") +* app.command.GotoNextTab [[UI]](#requiresUI "Requires UI") +* app.command.GotoPreviousFrameWithSameTag [[UI]](#requiresUI "Requires UI") +* app.command.GotoPreviousFrame [[UI]](#requiresUI "Requires UI") +* app.command.GotoPreviousLayer [[UI]](#requiresUI "Requires UI") +* app.command.GotoPreviousTab [[UI]](#requiresUI "Requires UI") +* app.command.GridSettings [[UI]](#requiresUI "Requires UI") + * Opens the grid settings window +* app.command.Home [[UI]](#requiresUI "Requires UI") + * Opens the Home tab +* [app.command.HueSaturation](command/HueSaturation.md#huesaturation) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.ImportSpriteSheet](command/ImportSpriteSheet.md#importspritesheet) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.InvertColor](command/InvertColor.md#invertcolor) [[*]](#canHaveUI "Can have UI interaction") * app.command.InvertMask -* app.command.KeyboardShortcuts + * Inverts the current selection mask, or if there is none, selects all +* app.command.KeyboardShortcuts [[UI]](#requiresUI "Requires UI") + * Opens the keyboard shortcut menu, use the `search` parameter to pre-fill the searchbar * app.command.Launch + * Opens the given `path` in the desktop web browser as relative path to aseprite.org or a full URL * app.command.LayerFromBackground + * Converts the active background layer to a regular layer * app.command.LayerLock + * Toggles the lock of active layers * [app.command.LayerOpacity](command/LayerOpacity.md#layeropacity) -* app.command.LayerProperties +* app.command.LayerProperties [[UI]](#requiresUI "Requires UI") + * Opens the Layer property window for the active layer * app.command.LayerVisibility + * Toggles the visibility of the active layer * app.command.LinkCels -* app.command.LoadMask -* app.command.LoadPalette + * Links the selected cels together +* [app.command.LoadMask](command/LoadMask.md#loadmask "Loads a selection from file") [[*]](#canHaveUI "Can have UI interaction") +* [app.command.LoadPalette](command/LoadPalette.md#loadpalette "Loads a palette from file") [[*]](#canHaveUI "Can have UI interaction") * app.command.MaskAll -* app.command.MaskByColor + * Selects all +* [app.command.MaskByColor](command/MaskByColor.md#maskbycolor "Creates a new selection by color") [[*]](#canHaveUI "Can have UI interaction") * app.command.MaskContent + * Selects the content from the active sprite (like autocrop) * app.command.MergeDownLayer -* app.command.ModifySelection -* app.command.MoveCel + * Merges the active layer down +* [app.command.ModifySelection](command/ModifySelection.md#modifyselection) [[*]](#canHaveUI "Can have UI interaction") +* app.command.MoveCel [[UI]](#requiresUI "Requires UI") + * Finishes the move operation of a cel in the timeline * [app.command.MoveColors](command/MoveColors.md#movecolors) -* [app.command.MoveMask](command/MoveMask.md#movemask) -* app.command.NewBrush +* [app.command.MoveMask](command/MoveMask.md#movemask "Moves the selection boundaries or its content (pixels).") +* app.command.NewBrush [[UI]](#requiresUI "Requires UI") + * Create a new brush from the current selection/editor * [app.command.NewFile](command/NewFile.md#newfile) -* app.command.NewFrameTag -* app.command.NewFrame -* [app.command.NewLayer](command/NewLayer.md#newlayer) +* app.command.NewFrameTag [[UI]](#requiresUI "Requires UI") + * Shows the New Tag dialog for the selected frame range +* [app.command.NewFrame](command/NewFrame.md#newframe) +* [app.command.NewLayer](command/NewLayer.md#newlayer) [[*]](#canHaveUI "Can have UI interaction") * app.command.NewSpriteFromSelection -* app.command.OpenBrowser -* app.command.OpenFile + * Creates a new sprite from the current selection mask +* app.command.OpenBrowser [[UI]](#requiresUI "Requires UI") + * Open the given `filename` in the internal text browser +* [app.command.OpenFile](command/OpenFile.md#openfile) * app.command.OpenGroup + * Opens the active layer group * app.command.OpenInFolder + * Opens the folder of the active sprite in the file explorer * app.command.OpenScriptFolder + * Opens the Aseprite script folder in the file explorer * app.command.OpenWithApp -* [app.command.Options](command/Options.md#options) -* [app.command.Outline](command/Outline.md#outline) -* app.command.PaletteEditor -* app.command.PaletteSize -* app.command.PasteText + * Opens the active sprite with the native app assigned to the format +* [app.command.Options](command/Options.md#options) [[UI]](#requiresUI "Requires UI") +* [app.command.Outline](command/Outline.md#outline) [[*]](#canHaveUI "Can have UI interaction") +* app.command.PaletteEditor [[UI]](#requiresUI "Requires UI") + * Show the palette editor popup +* [app.command.PaletteSize](command/PaletteSize.md#palettesize "Changes the palette size") [[*]](#canHaveUI "Can have UI interaction") +* app.command.PasteText [[UI]](#requiresUI "Requires UI") + * Opens the Insert Text dialog * app.command.Paste + * Pastes the clipboard into the current active sprite/selection, at coordinates `x` and `y` (if given) * app.command.PixelPerfectMode -* app.command.PlayAnimation -* app.command.PlayPreviewAnimation + * Toggles the "pixel perfect" freehand algorithm +* app.command.PlayAnimation [[UI]](#requiresUI "Requires UI") + * Plays the sprite's animation, if any +* app.command.PlayPreviewAnimation [[UI]](#requiresUI "Requires UI") + * Plays the animation in the preview window (enables it if it's not visible) * app.command.Redo -* app.command.Refresh + * Equivalent to `app.redo()` +* app.command.Refresh [[UI]](#requiresUI "Requires UI") + * Refreshes the user interface * app.command.RemoveFrameTag + * Remove a tag by the given `name` or object `id` * app.command.RemoveFrame + * Remove the selected or the current active frame(s) (only if there's more 1 frame total) * app.command.RemoveLayer + * Remove the selected or current active layer(s) (only if there's more than 1 layer total) * app.command.RemoveSlice -* app.command.RepeatLastExport -* [app.command.ReplaceColor](command/ReplaceColor.md#replacecolor) + * Remove a slice by `name` or object `id` +* app.command.RepeatLastExport [[*]](#canHaveUI "Can have UI interaction") + * Redoes the last export command +* [app.command.ReplaceColor](command/ReplaceColor.md#replacecolor) [[*]](#canHaveUI "Can have UI interaction") * app.command.ReselectMask + * Re-selects a hidden selection mask * app.command.ReverseFrames -* app.command.Rotate + * Reverses frames (only if there are 2 or more in the selected range) +* [app.command.Rotate](command/Rotate.md#rotate) * app.command.RunScript -* [app.command.SaveFile](command/SaveFile.md#savefile) -* [app.command.SaveFileAs](command/SaveFile.md#savefile) -* [app.command.SaveFileCopyAs](command/SaveFile.md#savefile) -* app.command.SaveMask -* app.command.SavePalette -* app.command.ScrollCenter -* app.command.Scroll -* app.command.SelectTile + * Run a script given by the `filename` parameter - any other parameters are passed to the script. +* [app.command.SaveFile](command/SaveFile.md#savefile) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.SaveFileAs](command/SaveFile.md#savefileas) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.SaveFileCopyAs](command/SaveFile.md#savefile) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.SaveMask](command/SaveMask.md#savemask) [[*]](#canHaveUI "Can have UI interaction") +* [app.command.SavePalette](command/SavePalette.md#savepalette) [[*]](#canHaveUI "Can have UI interaction") +* app.command.ScrollCenter [[*]](#canHaveUI "Can have UI interaction") + * Center the editor viewport +* [app.command.Scroll](command/Scroll.md#scroll) [[UI]](#requiresUI "Requires UI") +* app.command.SelectTile [[UI]](#requiresUI "Requires UI") + * Select the tile under the mouse, with a selection `mode` ([SelectionMode](selectionmode.md)) * app.command.SelectionAsGrid -* app.command.SetColorSelector -* [app.command.SetInkType](command/SetInkType.md) -* app.command.SetLoopSection -* app.command.SetPaletteEntrySize -* app.command.SetPalette + * Set the grid bounds to the current selection mask +* app.command.SetColorSelector [[UI]](#requiresUI "Requires UI") + * Changes the color selector to the `type`: "`spectrum`", `"tint-shade-tone"`, `"rgb-wheel"`, `"ryb-wheel"` or `"normal-map-wheel"` +* [app.command.SetInkType](command/SetInkType.md) [[UI]](#requiresUI "Requires UI") +* [app.command.SetLoopSection](command/SetLoopSection.md "Sets the looping property of the given frame range") +* app.command.SetPaletteEntrySize [[UI]](#requiresUI "Requires UI") + * Set the palette entry size to the given `size` (defaults to `7`) * app.command.SetSameInk + * Set the same ink for all tools * app.command.ShowAutoGuides + * Toggles the "Show Auto Guides" preference * app.command.ShowBrushPreview + * Toggles the "Brush Preview" preference * app.command.ShowExtras + * Toggles the "Show Extras" preference * app.command.ShowGrid + * Toggles the "Show Grid" preference * app.command.ShowLayerEdges + * Toggles the "Show Layer Edges" preference * app.command.ShowOnionSkin + * Toggles the "Onion Skin" preference * app.command.ShowPixelGrid + * Toggles the "Show Pixel Grid" preference * app.command.ShowSelectionEdges + * Toggles the "Show Selection Edges" preference * app.command.ShowSlices -* app.command.SliceProperties + * Toggles the "Show Slices" preference +* app.command.SliceProperties [[UI]](#requiresUI "Requires UI") + * Shows the slice properties window by `name` or `id` parameters, otherwise uses the selected slice(s) * app.command.SnapToGrid + * Toggles the snap to grid property * app.command.SpriteProperties -* [app.command.SpriteSize](command/SpriteSize.md) + * Shows the sprite properties window +* [app.command.SpriteSize](command/SpriteSize.md#spritesize) * app.command.Stroke -* app.command.SwitchColors + * Performs a foreground color stroke fill on the current selection mask +* app.command.SwitchColors [[UI]](#requiresUI "Requires UI") + * Swaps the current foreground/background colors around * app.command.SymmetryMode + * Sets the symmetry mode `orientation` to one of `"vertical"`, `"horizontal"`, `"right_diagonal"` or `"left_diagonal"`. Defaults to none, which turns the mode off * app.command.TiledMode -* app.command.Timeline -* app.command.TogglePreview + * Sets the tiled to mode `axis` to one of `"both"`, `"x"` or `"y"`. Defaults to none, which turns the mode off +* app.command.Timeline [[UI]](#requiresUI "Requires UI") + * Changes the timeline visibility with the parameters `open`, `close` and `switch` +* app.command.TogglePreview [[UI]](#requiresUI "Requires UI") + * Toggles the visibility of the preview window * app.command.ToggleTimelineThumbnails + * Toggles the timeline thumbnails preference * app.command.UndoHistory + * Shows the undo history window * app.command.Undo * app.command.UnlinkCel -* app.command.Zoom + * Equivalent to `app.undo()` +* [app.command.Zoom](command/Zoom.md#zoom "Changes the zoom on the active editor") [[UI]](#requiresUI "Requires UI") + +## Annotations + + +> **[*]** - Can have UI interactions, controlled by the `ui` parameter. + + +> **[UI]** - Requires the UI to be present, cannot be used in --batch mode. + +## Error Handling + +If the command fails to run or is disabled, it will return `false`. +To check if a command is enabled and can be run, you can use `app.command.[COMMAND NAME].enabled` before calling it. + +## Source -If you cannot find a specific command, you might like to give a look at the +If you cannot find a specific command, you might like to take a look at the [gui.xml](https://github.com/aseprite/aseprite/blob/main/data/gui.xml) file which contains the definitions of menus / commands + the parameters. diff --git a/api/command/AddColor.md b/api/command/AddColor.md index 0506b14..67b1de1 100644 --- a/api/command/AddColor.md +++ b/api/command/AddColor.md @@ -7,10 +7,10 @@ app.command.AddColor { } ``` -Adds a new color into the palette. +Adds a new color to the palette. * `source`: Can be `"fg"`, `"bg"`, or `"color"` (default). To add the foreground, background, or a specific color respectively. -* `color`: A [Color](../color.md#color) instance to add too the palette. +* `color`: A [Color](../color.md#color) instance to add to the palette. ## Example diff --git a/api/command/AutocropSprite.md b/api/command/AutocropSprite.md new file mode 100644 index 0000000..feaab53 --- /dev/null +++ b/api/command/AutocropSprite.md @@ -0,0 +1,11 @@ +# AutocropSprite + +```lua +app.command.AutocropSprite { + byGrid=bool +} +``` + +Automatically crops the sprite. + +* `byGrid`: Aligns the crop to the grid. Optional, defaults to `false`. diff --git a/api/command/BrightnessContrast.md b/api/command/BrightnessContrast.md index 42befde..e129592 100644 --- a/api/command/BrightnessContrast.md +++ b/api/command/BrightnessContrast.md @@ -2,16 +2,14 @@ ```lua app.command.BrightnessContrast { - ui=true, + ui=bool, channels=FilterChannels..., - brightness=0, - contrast=0 + brightness=int, + contrast=int } ``` -* `ui`: Shows the dialog on the screen, `true` by default. Set to - `false` for automatic change brightness and/or contrast without - asking to the user for the change. +* `ui`: Shows the brightness dialog, `true` by default. Set to `false` to apply the changes immediately without user input or preview. * `channels`: A combination of [FilterChannels](../filterchannels.md#filterchannels) with [bitwise OR (`|`) operator](https://www.lua.org/manual/5.3/manual.html#3.4.2). By default it is equal to: diff --git a/api/command/CanvasSize.md b/api/command/CanvasSize.md index 24dd85f..b0e4ee8 100644 --- a/api/command/CanvasSize.md +++ b/api/command/CanvasSize.md @@ -2,13 +2,13 @@ ```lua app.command.CanvasSize { - ui=true, - left=0, - top=0, - right=0, - bottom=0, + ui=bool, + left=int, + top=int, + right=int, + bottom=int, bounds=Rectangle, - trimOutside=false + trimOutside=bool } ``` diff --git a/api/command/CelOpacity.md b/api/command/CelOpacity.md index d987d2d..bd8dd8c 100644 --- a/api/command/CelOpacity.md +++ b/api/command/CelOpacity.md @@ -2,7 +2,7 @@ ```lua app.command.CelOpacity { - opacity = 0 + opacity=int } ``` diff --git a/api/command/ChangeBrush.md b/api/command/ChangeBrush.md new file mode 100644 index 0000000..4380b89 --- /dev/null +++ b/api/command/ChangeBrush.md @@ -0,0 +1,14 @@ +# ChangeBrush + +```lua +app.command.ChangeBrush { + change=string + slot=int +} +``` + +Changes the brush of the active tool + +* `change`: Can be: "increment-size", "decrement-size", "increment-angle", "decrement-angle", "flip-x", "flip-y", "flip-d", "rotate-90cw", "custom" +* `slot`: Custom brush slot (optional, only for "custom" change) + diff --git a/api/command/ChangeColor.md b/api/command/ChangeColor.md new file mode 100644 index 0000000..9c534c0 --- /dev/null +++ b/api/command/ChangeColor.md @@ -0,0 +1,13 @@ +# ChangeColor + +```lua +app.command.ChangeColor { + target=string + change=string +} +``` + +Changes the current foreground or background color by moving up or down on the palette by index. + +* `target`: Can be `"foreground"` or `"background"` +* `change`: Can be `"increment-index"` or `"decrement-index"` diff --git a/api/command/ChangePixelFormat.md b/api/command/ChangePixelFormat.md index 43afdd8..ae625b2 100644 --- a/api/command/ChangePixelFormat.md +++ b/api/command/ChangePixelFormat.md @@ -6,22 +6,23 @@ app.command.ChangePixelFormat { dithering=string, ["dithering-matrix"]=string, rgbmap=string, - toGray=string + toGray=string, + fitCriteria=string } ``` Changes the [ColorMode](../colormode.md) of the active [sprite](../sprite.md) -* `format`: Can be `"rgb"`, `"gray"`, or `"indexed"`. -* `dithering`: Can be `"ordered"`, `"old"` `"error-diffusion"`, - or empty. -* `dithering-matrix`: It can be `"bayer8x8"`, `"bayer4x4"`, or `"bayer2x2"` (when When `dithering` is `ordered` or `old`). - Actually it can be a matrix ID from any extensions ([for example](https://github.com/aseprite/aseprite/blob/fc79146c56f941f834f28809f0d2c4d7fd60076c/data/extensions/bayer-matrices/package.json#L8)). -* `rgmap`: `"octree"`, `"rgb5a3"`, or `"default"` (generally default +* `format`: `"rgb"`, `"gray"`, or `"indexed"`. +* `dithering`: Optional, `"ordered"`, `"old"` `"error-diffusion"` +* `dithering-matrix`: Optional, `"bayer8x8"`, `"bayer4x4"`, or `"bayer2x2"` (when When `dithering` is `ordered` or `old`). + Actually it can be a matrix ID from any extension ([for example](https://github.com/aseprite/aseprite/blob/fc79146c56f941f834f28809f0d2c4d7fd60076c/data/extensions/bayer-matrices/package.json#L8)). +* `rgbmap`: Optional, `"octree"`, `"rgb5a3"`, or `"default"` (generally default will be octree, but it might change in the future). If nothing is - specified the default configured quantization method from prefereces + specified the default configured quantization method from preferences will be used if the GUI is enabled. -* `toGray`: `"luma"`, `"hsv"`, or `"hsl"`. +* `toGray`: Optional, `"luma"`, `"hsv"`, or `"hsl"`. +* `fitCriteria`: Optional, `"rgb"`, `"linearizedRGB"`, `"ciexyz"`, `"cielab"`, or `"default"` ## Example diff --git a/api/command/ColorCurve.md b/api/command/ColorCurve.md index 3ab5b94..694cb7d 100644 --- a/api/command/ColorCurve.md +++ b/api/command/ColorCurve.md @@ -2,15 +2,14 @@ ```lua app.command.ColorCurve { - ui=true, + ui=bool, channels=FilterChannels..., curve={ Point, Point, Point... } } ``` * `ui`: Shows the dialog on the screen, `true` by default. Set to - `false` to apply the color curve filter automatically without asking - to the user for the change. + `false` to apply the color curve filter automatically without user input. * `channels`: A combination of [FilterChannels](../filterchannels.md#filterchannels) with [bitwise OR (`|`) operator](https://www.lua.org/manual/5.3/manual.html#3.4.2). By default it is equal to: diff --git a/api/command/ColorQuantization.md b/api/command/ColorQuantization.md new file mode 100644 index 0000000..462501f --- /dev/null +++ b/api/command/ColorQuantization.md @@ -0,0 +1,30 @@ +# ColorQuantization + +```lua +app.command.ColorQuantization { + ui=bool, + withAlpha=bool, + maxColors=int, + useRange=bool, + algorithm=string, +} +``` + +Creates a palette from the current sprite + +* `ui`: Shows the dialog on the screen, `true` by default. +* `withAlpha`: Create entries with alpha component, defaults to `true` +* `maxColors`: Color amount limit, defaults to `256` +* `useRange`: Replace current range, defaults to `false` +* `algorithm`: One of `"default"`, `"rgb5a3"` or `"octree"` + +## Example + +```lua +app.command.ColorQuantization { + ui=true, + withAlpha=false, + maxColors=100, + algorithm="octree" +} +``` diff --git a/api/command/ConvolutionMatrix.md b/api/command/ConvolutionMatrix.md index 277814e..6c09bce 100644 --- a/api/command/ConvolutionMatrix.md +++ b/api/command/ConvolutionMatrix.md @@ -2,16 +2,14 @@ ```lua app.command.ConvolutionMatrix { - ui=true, + ui=bool, channels=FilterChannels..., - tiledMode=none, + tiledMode=string, fromResource=string } ``` -* `ui`: Shows the dialog on the screen, `true` by default. Set to - `false` to apply the convolution matrix filter automatically without - asking to the user for the change. +* `ui`: Shows the dialog on the screen, `true` by default. Set to `false` to apply the convolution matrix filter automatically without asking to the user for confirmation. * `channels`: A combination of [FilterChannels](../filterchannels.md#filterchannels) with [bitwise OR (`|`) operator](https://www.lua.org/manual/5.3/manual.html#3.4.2). By default it is equal to: @@ -19,10 +17,7 @@ app.command.ConvolutionMatrix { [FilterChannels.GREEN](../filterchannels.md#filterchannelsgreen) | [FilterChannels.BLUE](../filterchannels.md#filterchannelsblue) | [FilterChannels.GRAY](../filterchannels.md#filterchannelsgray). -* `tiledMode`: `'none'`, `'x'`, `'y'`, `'both'`. By default it's - `'none'` if there is no UI, or it's equal to `app.preferences.document(app.sprite).tiled.mode` - when `ui` is `true`. +* `tiledMode`: `'none'`, `'x'`, `'y'`, `'both'`. Defaults to `'none'` if there is no UI, or it's equal to `app.preferences.document(app.sprite).tiled.mode` when `ui` is `true`. * `fromResource`: Name of [pre-defined convolution matrix](https://github.com/aseprite/aseprite/blob/a70a3a11c71ae96eb6af3756525182e88129ffcd/data/convmatr.def#L34). -*Note*: In future versions this function should support creating -customized convolution matrices. +*Note*: In future versions this function should support creating customized convolution matrices. diff --git a/api/command/CopyColors.md b/api/command/CopyColors.md index 1a67088..05c7317 100644 --- a/api/command/CopyColors.md +++ b/api/command/CopyColors.md @@ -6,6 +6,4 @@ app.command.CopyColors { } ``` -Copies the range selected colors -[`app.range.colors`](../range.md#rangecolors) before the given -`colorIndex`. +Copies the range selected colors [`app.range.colors`](../range.md#rangecolors) before the given `colorIndex`. diff --git a/api/command/CropSprite.md b/api/command/CropSprite.md new file mode 100644 index 0000000..952cc2d --- /dev/null +++ b/api/command/CropSprite.md @@ -0,0 +1,18 @@ +# CropSprite + +```lua +app.command.CropSprite { + x=int, + y=int, + width=int, + height=int +} +``` + +Crops the sprite to the given bounds. +All parameters default to 0, if none are not given, the sprite will be cropped to the mask bounds. + +* `x`: The X value of the crop bounds +* `x`: The Y value of the crop bounds +* `width`: The crop width +* `height`: The crop height diff --git a/api/command/Despeckle.md b/api/command/Despeckle.md index ecd0f13..89a29ad 100644 --- a/api/command/Despeckle.md +++ b/api/command/Despeckle.md @@ -2,11 +2,11 @@ ```lua app.command.Despeckle { - ui=true, - channels=..., - width=3, - height=3, - tiledMode=none, + ui=bool, + channels=FilterChannels..., + width=int, + height=int, + tiledMode=string, } ``` @@ -20,6 +20,6 @@ app.command.Despeckle { [FilterChannels.GRAY](../filterchannels.md#filterchannelsgray). * `width`: Width of the convolution matrix to calculate the median. `3` by default. * `height`: Height of the convolution matrix to calculate the median. `3` by default. -* `tiledMode`: `'none'`, `'x'`, `'y'`, `'both'`. By default it's - `'none'` if there is no UI, or it's equal to `app.preferences.document(app.sprite).tiled.mode` +* `tiledMode`: `"none"`, `"x"`, `"y"`, `"both"`. By default it's + `"none"` if there is no UI, or it's equal to `app.preferences.document(app.sprite).tiled.mode` when `ui` is `true`. diff --git a/api/command/DuplicateSprite.md b/api/command/DuplicateSprite.md new file mode 100644 index 0000000..eca7d6d --- /dev/null +++ b/api/command/DuplicateSprite.md @@ -0,0 +1,15 @@ +# DuplicateSprite + +```lua +app.command.DuplicateSprite { + ui=bool, + filename=string, + flatten=bool +} +``` + +Duplicates the current sprite + +* `ui`: Shows the duplicate dialog, `true` by default. Set to `false` to create the duplicate automatically. +* `filename`: New filename for the sprite, if left empty it will auto-generate a new one. +* `flatten`: Duplicate merged layers only. Defaults to `false`. diff --git a/api/command/ExportTileset.md b/api/command/ExportTileset.md index 58dd271..a37f9e4 100644 --- a/api/command/ExportTileset.md +++ b/api/command/ExportTileset.md @@ -3,7 +3,7 @@ ```lua app.command.ExportTileset { dataFormat=SpriteSheetDataFormat.JSON_ARRAY, - fromTilesets=true + fromTilesets=bool } ``` @@ -11,4 +11,4 @@ This is similar to using [the `-export-tileset` argument from the CLI](https://www.aseprite.org/docs/cli/#export-tileset) with [`-format=json-array` option](https://www.aseprite.org/docs/cli/#format). -This command accept the same parameters as [app.command.SaveFileCopyAs](SaveFile.md#savefile). +This command accepts the same parameters as [app.command.SaveFileCopyAs](SaveFile.md#savefile). diff --git a/api/command/FlattenLayers.md b/api/command/FlattenLayers.md new file mode 100644 index 0000000..dfc6350 --- /dev/null +++ b/api/command/FlattenLayers.md @@ -0,0 +1,11 @@ +# FlattenLayers + +```lua +app.command.FlattenLayers { + visibleOnly=bool +} +``` + +Flattens the current layers into one. + +* `visibleOnly`: Set to `true` to only flatten the visible layers, defaults to `false`. diff --git a/api/command/Flip.md b/api/command/Flip.md new file mode 100644 index 0000000..9753b98 --- /dev/null +++ b/api/command/Flip.md @@ -0,0 +1,15 @@ +# Flip + +```lua +app.command.Flip { + target=string + orientation=string +} +``` + +Flips the whole sprite or the current selection mask, either vertically or horizontally. + +Note: When specifying `target=mask` without a UI or with no active mask, the entire sprite will be flipped. + +* `target`: Can be `"mask"` or `"sprite"`. Defaults to "`sprite`". +* `change`: Can be `"vertical"` or `"horizontal"`. Defaults to "`horizontal`". diff --git a/api/command/FrameProperties.md b/api/command/FrameProperties.md new file mode 100644 index 0000000..5f60f96 --- /dev/null +++ b/api/command/FrameProperties.md @@ -0,0 +1,11 @@ +# FrameProperties + +```lua +app.command.FrameProperties { + frame=string or int +} +``` + +Shows the Frame Properties dialog + +* `target`: Can be `"all"`, `"current"` or the frame number. Defaults to "`all`". diff --git a/api/command/FrameTagProperties.md b/api/command/FrameTagProperties.md new file mode 100644 index 0000000..b819047 --- /dev/null +++ b/api/command/FrameTagProperties.md @@ -0,0 +1,11 @@ +# FrameProperties + +```lua +app.command.FrameProperties { + name=string +} +``` + +Shows the Frame Tag Properties dialog for the given name, or the first tag if no name is given. + +`name`: Tag name. \ No newline at end of file diff --git a/api/command/HueSaturation.md b/api/command/HueSaturation.md index 580f20c..719c11e 100644 --- a/api/command/HueSaturation.md +++ b/api/command/HueSaturation.md @@ -2,19 +2,17 @@ ```lua app.command.HueSaturation { - ui=true, + ui=bool, channels=FilterChannels..., - mode='hsl', - hue=0, - saturation=0, - lightness=0, - alpha=0 + mode=string, + hue=int, + saturation=int, + lightness=int, + alpha=int } ``` -* `ui`: Shows the dialog on the screen, `true` by default. Set to - `false` for automatic change brightness and/or contrast without - asking to the user for the change. +* `ui`: Shows the dialog on the screen, `true` by default. Set to `false` for automatic change brightness and/or contrast without asking the user for confirmation. * `channels`: A combination of [FilterChannels](../filterchannels.md#filterchannels) with [bitwise OR (`|`) operator](https://www.lua.org/manual/5.3/manual.html#3.4.2). By default it is equal to: @@ -22,7 +20,7 @@ app.command.HueSaturation { [FilterChannels.GREEN](../filterchannels.md#filterchannelsgreen) | [FilterChannels.BLUE](../filterchannels.md#filterchannelsblue) | [FilterChannels.GRAY](../filterchannels.md#filterchannelsgray). -* `mode`: `'hsl'` (default) or `'hsv'` +* `mode`: `"hsl"` (default) or `"hsv"` * `hue`: From `-180` to `180` * `saturation`: From `-100` to `100` * `lightness` (or `value`): From `-100` to `100` diff --git a/api/command/ImportSpriteSheet.md b/api/command/ImportSpriteSheet.md index be35472..438f4fc 100644 --- a/api/command/ImportSpriteSheet.md +++ b/api/command/ImportSpriteSheet.md @@ -2,10 +2,10 @@ ```lua app.command.ImportSpriteSheet { - ui=true, - type=SpriteSheetType.ROWS, + ui=bool, + type=SpriteSheetType.ROWS..., frameBounds=Rectangle, - padding=Size(0, 0), - partialTiles=false + padding=Size, + partialTiles=bool } ``` diff --git a/api/command/InvertColor.md b/api/command/InvertColor.md index 74781e9..badd647 100644 --- a/api/command/InvertColor.md +++ b/api/command/InvertColor.md @@ -2,7 +2,7 @@ ```lua app.command.InvertColor { - ui=true, + ui=bool, channels=FilterChannels... } ``` diff --git a/api/command/LayerOpacity.md b/api/command/LayerOpacity.md index f7e8435..bbb53a3 100644 --- a/api/command/LayerOpacity.md +++ b/api/command/LayerOpacity.md @@ -2,7 +2,7 @@ ```lua app.command.LayerOpacity { - opacity = 0 + opacity = 0 } ``` diff --git a/api/command/LoadMask.md b/api/command/LoadMask.md new file mode 100644 index 0000000..325f796 --- /dev/null +++ b/api/command/LoadMask.md @@ -0,0 +1,15 @@ +# LoadMask + +```lua +app.command.LoadMask { + ui=bool, + filename=string +} +``` + +Loads a mask from the given *.msk file. + +* `ui`: Shows the file picker dialog with `filename` pre-completed, `true` by default. Set to + `false` to load `filename`directly without user confirmation. +* `filename`: A path to a *.msk file or a path to pre-load into the file picker dialog. + diff --git a/api/command/LoadPalette.md b/api/command/LoadPalette.md new file mode 100644 index 0000000..0403fb9 --- /dev/null +++ b/api/command/LoadPalette.md @@ -0,0 +1,17 @@ +# LoadPalette + +```lua +app.command.LoadPalette { + ui=bool, + filename=string + preset=string +} +``` + +Loads a palette from the given `preset` or `filename`. + +* `ui`: Shows the file picker dialog with `filename` pre-completed, `true` by default. Set to + `false` to load `filename` directly without user confirmation. +* `filename`: A path to a supported palette or file to extract a palette from, optional. +* `preset`: The name of a palette preset, `"default"` resets the palette to default. If set, `filename` is ignored. + diff --git a/api/command/MaskByColor.md b/api/command/MaskByColor.md new file mode 100644 index 0000000..f50817a --- /dev/null +++ b/api/command/MaskByColor.md @@ -0,0 +1,17 @@ +# MaskByColor + +```lua +app.command.MaskByColor { + ui=bool, + color=Color, + tolerance=int, + mode=SelectionMode +} +``` + +Creates a new selection by color + +* `ui`: Shows the dialog on the screen, `true` by default. Set to `false` to select automatically. +* `color`: The [color](../color.md#color) to mask by. Defaults to the current foreground color. +* `tolerance`: The maximum allowed difference between `color` and the pixel to be selected, from `0` to `255`. Defaults to `0` +* `mode`: [SelectionMode](../selectionmode.md) diff --git a/api/command/ModifySelection.md b/api/command/ModifySelection.md new file mode 100644 index 0000000..8cc6d2e --- /dev/null +++ b/api/command/ModifySelection.md @@ -0,0 +1,17 @@ +# ModifySelection + +```lua +app.command.ModifySelection { + ui=bool, + modifier=string, + quantity=int, + brush=string +} +``` + +Modifies the active selection. + +* `ui`: Shows the selection modification dialog on screen, `true` by default. Set to `false` to modify automatically. +* `modifier`: One of `"border"`, `"expand"`, or `"contract"`. +* `quantity`: The pixel amount to modify the selection by. *Note*: Will attempt to show the UI if set to `0`. +* `brush`: One of `"circle"`, or `"square"`. diff --git a/api/command/MoveColors.md b/api/command/MoveColors.md index cc66cf2..1c8e19f 100644 --- a/api/command/MoveColors.md +++ b/api/command/MoveColors.md @@ -6,6 +6,4 @@ app.command.MoveColors { } ``` -Moves the range selected colors -[`app.range.colors`](../range.md#rangecolors) before the given -`colorIndex`. +Moves the range selected colors [`app.range.colors`](../range.md#rangecolors) before the given `colorIndex`. diff --git a/api/command/MoveMask.md b/api/command/MoveMask.md index 32ac07a..e8b93e8 100644 --- a/api/command/MoveMask.md +++ b/api/command/MoveMask.md @@ -1,38 +1,24 @@ # MoveMask -Moves the selection boundaries or its content (pixels). - ```lua app.command.MoveMask { - target='boundaries' | 'content', - wrap=false, - direction='left' | 'right' | 'up' | 'down', - units='pixel', - quantity=1 + target=string, + wrap=bool, + direction=string, + units=string, + quantity=int } ``` +Moves the selection boundaries or its content (pixels). + * `target` (string): must be - * `'boundaries'` to modify selection boundaries onlyor + * `'boundaries'` to modify selection boundaries only or * `'content'` to modify the selection content ([active cel](../app.md#appcel) pixels) * `wrap`: `true` or `false`, when true it does the *Edit > Shift* effect, were pixels from one side in will appear from the other side (so the content is shifted and pixels wrapped, so the selection boundaries is not moved at all, only pixels inside it) -* `direction` (string): the selection will be moved to a specific direction: - * `'left'` - * `'right'` - * `'up'` - * `'down'` -* `units` (string): must be one of these options (generally `pixel` is - enough for scripts, and other options are just for UI): - * `'pixel'` - * `'tile-width'` - * `'tile-height'` - * `'zoomed-pixel'` - * `'zoomed-tile-width'` - * `'zoomed-tile-height'` - * `'viewport-width'` - * `'viewport-height'` -* `quantity`: the number of `pixel`s, or `tile-width`s, etc. to move - the selection to the given `direction` depending on the `units` +* `direction`: The selection will be moved to a specific direction, can be `"left"`, `"right"`, `"up"` or `"down"`. +`units`: The unit to use for `quantity`. Can be `"pixel"`, `"tile-width"`, `"tile-height"` `"zoomed-pixel"`, `"zoomed-tile-width"`, `"zoomed-tile-height"`, `"viewport-width"`, `"viewport-height"`. +* `quantity`: the number of `pixel`s, or `tile-width`s, etc. to move the selection to the given `direction` depending on the `units`. diff --git a/api/command/NewFile.md b/api/command/NewFile.md index 7d615df..9967382 100644 --- a/api/command/NewFile.md +++ b/api/command/NewFile.md @@ -2,16 +2,16 @@ ```lua app.command.NewFile { - ui=true, - width=0, - height=0, - colorMode=ColorMode.RGB, - fromClipboard=false + ui=bool, + width=int, + height=int, + colorMode=ColorMode, + fromClipboard=bool } ``` -* `ui` -* `width` -* `height` +* `ui`: Shows the new file dialog, defaults to `true`. +* `width`: The width of the new sprite, ignored when using `fromClipboard`. +* `height`: The height of the new sprite, ignored when using `fromClipboard`. * `colorMode` ([ColorMode](../colormode.md#colormode)) -* `fromClipboard` +* `fromClipboard`: Use the current clipboard to create the file. diff --git a/api/command/NewFrame.md b/api/command/NewFrame.md new file mode 100644 index 0000000..af5a937 --- /dev/null +++ b/api/command/NewFrame.md @@ -0,0 +1,11 @@ +# NewFrame + +```lua +app.command.NewFrame { + content=string +} +``` + +Creates a new frame. + +* `content`: The contents of the frame, defaults to `"current"`. One of `"current"`, `"empty"`, `"cel"`, `"celcopies"`, `"cellinked"` diff --git a/api/command/NewLayer.md b/api/command/NewLayer.md index 6878350..849b7a4 100644 --- a/api/command/NewLayer.md +++ b/api/command/NewLayer.md @@ -2,25 +2,25 @@ ```lua app.command.NewLayer { - name="", - group=false, - reference=false, - tilemap=false, + name=string, + group=bool, + reference=bool, + tilemap=bool, gridBounds=Rectangle, - ask=false, - fromFile=false, - fromClipboard=false, - viaCut=false, - viaCopy=false, - top=false, - before=false + ask=bool, + fromFile=bool, + fromClipboard=bool, + viaCut=bool, + viaCopy=bool, + top=bool, + before=bool } ``` * `name` (string): the name of the layer. -* `group`: `true` to make the new layer a group layer, this option is mutually exclusive to `reference`/`tilemap`. -* `reference`: `true` to make the new layer a reference layer, this option is mutually exclusive to `group`/`tilemap`. -* `tilemap`: `true` to make the new layer a tilemap layer, this option is mutually exclusive to `group`/`reference`. +* `group`: `true` to make the new layer a group layer, this option is mutually exclusive with `reference`/`tilemap`. +* `reference`: `true` to make the new layer a reference layer, this option is mutually exclusive with `group`/`tilemap`. +* `tilemap`: `true` to make the new layer a tilemap layer, this option is mutually exclusive with `group`/`reference`. * `gridBounds`: a [rectangle](../rectangle.md#rectangle) to specify the tilemap grid by default (instead of using the sprite grid) * `ask`: `true` to ask the user for a name if inside the interface. * `fromFile`: `true` to create the layer from a file, the Open File dialog will appear in the UI. diff --git a/api/command/OpenFile.md b/api/command/OpenFile.md new file mode 100644 index 0000000..e48ad1b --- /dev/null +++ b/api/command/OpenFile.md @@ -0,0 +1,20 @@ +# OpenFile + +```lua +app.command.OpenFile { + ui=bool, + filename=string, + folder=string, + repeat_checkbox=bool, + oneframe=bool, + sequence=string +} +``` + +Opens a file, or sequence of files (UI only through the dialog) + +* `ui`: Shows the file opening dialog, `true` by default. +* `filename`: The filename to open +* `folder`: Folder to pre-fill the dialog (with UI only) +* `repeat_checkbox`: Whether the file renaming actions for sequences will show a dialogue or use the given `sequence` (UI only) +* `sequence`: One of `"ask"`, `"yes"`, or `"no"`. diff --git a/api/command/Outline.md b/api/command/Outline.md index 013cbc1..467a914 100644 --- a/api/command/Outline.md +++ b/api/command/Outline.md @@ -2,13 +2,13 @@ ```lua app.command.Outline { - ui=true, + ui=bool, channels=FilterChannels..., - place='outside', - matrix='circle', - color=app.fgColor, - bgColor=Color(), - tiledMode='none' + place=string, + matrix=string, + color=Color, + bgColor=Color, + tiledMode=string } ``` diff --git a/api/command/PaletteSize.md b/api/command/PaletteSize.md new file mode 100644 index 0000000..0493a29 --- /dev/null +++ b/api/command/PaletteSize.md @@ -0,0 +1,13 @@ +# PaletteSize + +```lua +app.command.PaletteSize { + ui=bool, + size=int +} +``` + +Changes the palette size + +* `ui`: Shows the palette resizing dialog, defaults to `true`. +* `size`: The new palette size. *Note*: Will attempt to show the UI if set to `0`. \ No newline at end of file diff --git a/api/command/ReplaceColor.md b/api/command/ReplaceColor.md index 21a30f0..a5f7930 100644 --- a/api/command/ReplaceColor.md +++ b/api/command/ReplaceColor.md @@ -2,11 +2,11 @@ ```lua app.command.ReplaceColor { - ui=true, + ui=bool, channels=FilterChannels..., from=Color, to=Color, - tolerance=0 + tolerance=int } ``` @@ -14,7 +14,7 @@ app.command.ReplaceColor { `false` for automatic replacement without asking to the user for the change. When the dialog is displayed to the user, `app.command.ReplaceColor()` will return a `true` or `false` value - indicating if the replacement was accepeted or cancelled + indicating if the replacement was accepted or cancelled respectively. * `channels`: A combination of [FilterChannels](../filterchannels.md#filterchannels) with [bitwise OR (`|`) operator](https://www.lua.org/manual/5.3/manual.html#3.4.2). diff --git a/api/command/Rotate.md b/api/command/Rotate.md new file mode 100644 index 0000000..2bd8485 --- /dev/null +++ b/api/command/Rotate.md @@ -0,0 +1,17 @@ +# Rotate + +```lua +app.command.Rotate { + ui=bool, + target=string, + angle=string, +} +``` + +Rotates the sprite or mask, depending on `target`. + +**Note**: Mask rotation only works in UI mode (regardless of the `ui` parameter). + +* `ui`: Shows the rotation progress dialog, `true` by default. Set to `false` to rotate automatically. +* `target`: Can be `"default"` or `"mask"`. +* `angle`: The angle of rotation. diff --git a/api/command/SaveFile.md b/api/command/SaveFile.md index ef7a46c..0b80ce6 100644 --- a/api/command/SaveFile.md +++ b/api/command/SaveFile.md @@ -2,16 +2,16 @@ ```lua app.command.SaveFile { - ui=true, - recent=true, - filename="", - filenameFormat="", - tag="", + ui=bool, + recent=bool, + filename=string, + filenameFormat=string, + tag=string, aniDir=AniDir, - slice="", - fromFrame=frame, - toFrame=frame, - ignoreEmpty=false, + slice=string, + fromFrame=int, + toFrame=int, + ignoreEmpty=bool, bounds=Rectangle, } app.command.SaveFileAs { ... } diff --git a/api/command/SaveMask.md b/api/command/SaveMask.md new file mode 100644 index 0000000..ed54e9e --- /dev/null +++ b/api/command/SaveMask.md @@ -0,0 +1,15 @@ +# SaveMask + +```lua +app.command.SaveMask { + ui=bool, + filename=string +} +``` + +Saves the current selection mask to a *.msk file. + +* `ui`: Shows the file picker dialog with `filename` pre-completed, `true` by default. Set to + `false` to save `filename` directly without user confirmation. +* `filename`: A path to a *.msk file or a path to pre-load into the file picker dialog. Defaults to `default.msk`. + diff --git a/api/command/SavePalette.md b/api/command/SavePalette.md new file mode 100644 index 0000000..d487b28 --- /dev/null +++ b/api/command/SavePalette.md @@ -0,0 +1,20 @@ +# SavePalette + +```lua +app.command.SavePalette { + ui=bool, + filename=string, + preset=string, + saveAsPreset=bool, + columns=int +} +``` + +Saves the current palette to a file or the given preset. + +* `ui`: Shows the file picker dialog, `true` by default. +* `filename`: A path to where to save the palette. Optional and ignored if `saveAsPreset` is `true`. +* `preset`: The preset to save to. Optional. +* `saveAsPreset`: Whether to save to the preset or the file, defaults to +* `columns`: Defaults to `16`. + diff --git a/api/command/Scroll.md b/api/command/Scroll.md new file mode 100644 index 0000000..b84fe4f --- /dev/null +++ b/api/command/Scroll.md @@ -0,0 +1,25 @@ +# Scroll + +```lua +app.command.Scroll { + direction=string, + units=string, + quantity=int +} +``` + +Scrolls the active editor view according to the given parameters. + +* `direction`: The selection will be moved to a specific direction, can be `"left"`, `"right"`, `"up"` or `"down"`. +`units`: The unit to use for `quantity`. Can be `"pixel"`, `"tile-width"`, `"tile-height"` `"zoomed-pixel"`, `"zoomed-tile-width"`, `"zoomed-tile-height"`, `"viewport-width"`, `"viewport-height"`. +* `quantity`: the number of `pixel`s, or `tile-width`s, etc. to move the selection to the given `direction` depending on the `units`. + +# Example + +```lua +app.command.Scroll{ + quantity=50, + units="pixel", + direction="right" +} +``` \ No newline at end of file diff --git a/api/command/SetInkType.md b/api/command/SetInkType.md index 71f6cfd..ff8b727 100644 --- a/api/command/SetInkType.md +++ b/api/command/SetInkType.md @@ -2,7 +2,7 @@ ```lua app.command.SetInkType { - type="simple" + type=string } ``` diff --git a/api/command/SetLoopSection.md b/api/command/SetLoopSection.md new file mode 100644 index 0000000..3c3d3ef --- /dev/null +++ b/api/command/SetLoopSection.md @@ -0,0 +1,16 @@ +# SetLoopSection + +```lua +app.command.SetLoopSection { + action=string, + begin=int, + `end`=int, +} +``` + +Set the looping property of the given frame range. + +* `action`: The action to take. `"auto"` derives it from the selected range and ignores the `begin` and `end` parameters, `"on"` creates the looping section and `"off"` removes it. +* `begin`: The start of the frame range to change +* `end`: The end of the frame range. + diff --git a/api/command/SpriteSize.md b/api/command/SpriteSize.md index dca7c97..8175a85 100644 --- a/api/command/SpriteSize.md +++ b/api/command/SpriteSize.md @@ -2,14 +2,14 @@ ```lua app.command.SpriteSize { - ui=true, - width=100, - height=100, - scale=1.0, - scaleX=1.0, - scaleY=1.0, - lockRatio=false, - method="nearest" + ui=bool, + width=int, + height=int, + scale=double, + scaleX=double, + scaleY=double, + lockRatio=bool, + method=string } ``` @@ -22,7 +22,7 @@ app.command.SpriteSize { * `lockRatio`: Final sprite aspect ratio is locked when it is `true`.`false` by default. * `method`: Resize algorithm method to be used. `"nearest"` by default (Nearest Neighbor), alternatives: `"bilinear"` and `"rotSprite"`. -Known issue: On the following code, we have a variable `i` pointing to the `cel.image`. After the `app.command.SpriteSize` execution, `i` doesn't longer points to original image. Finally, `print(i.width)` will fail. +Known issue: On the following code, we have a variable `i` pointing to the `cel.image`. After the `app.command.SpriteSize` execution, `i` no longer points to the original image. Finally, `print(i.width)` will fail. ```lua local s = Sprite(1, 1) @@ -34,7 +34,7 @@ app.command.SpriteSize{ ui = false, scaleX = 2 } print(i.width) -- it will fail: ...attempt to index a nil value (global 'i') ``` -So, to make it works, we have to use `cel.image` instead of `i`: +So, to make it work, we have to use `cel.image` instead of `i`: ```lua local s = Sprite(1, 1) @@ -44,7 +44,7 @@ app.command.SpriteSize{ ui = false, scaleX = 2 } print(cel.image.width) -- it will print "2" ``` -Another way, using `i`, and get again the `cel.image` after `app.command.SpriteSize`: +Another way, using `i` is to again get the `cel.image` after `app.command.SpriteSize`: ```lua local s = Sprite(1, 1) diff --git a/api/command/Zoom.md b/api/command/Zoom.md new file mode 100644 index 0000000..0283a0f --- /dev/null +++ b/api/command/Zoom.md @@ -0,0 +1,15 @@ +# Zoom + +```lua +app.command.Zoom { + action=string, + percentage=int, + focus=string +} +``` + +Performs a zoom on the active editor. + +* `action`: One of `"in"`, `"out"`, or "`set`" +* `percentage`: The amount to set the zoom to (ignores `action`) +* `focus`: From where we are doing the zoom, can be `center` or `mouse` \ No newline at end of file diff --git a/api/site.md b/api/site.md index 66936c0..ca5cd83 100644 --- a/api/site.md +++ b/api/site.md @@ -2,7 +2,7 @@ This is an object that saves the active state of the editor in a specific moment. Which active sprite, layer, frame, cel, image, -etc. where in a specific moment. +etc. were in a specific moment. If you save the object: