aseprite / aseprite/api

Add API access for more Editor positions

Open
#173 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
307
Forks
68
PR merge metrics
No merged PRs in 30d

Description

Over the years of making plugins, I've often wanted to make sure to store or reset the editor as close to it's original state as possible after running a script or plugin. For example, if I'm reloading a sprite, I'd still want the `editor.Scroll` and `editor.Zoom` to remain the same so the reload isn't as jarring.

However, there are multiple areas of the editor where this isn't possible, because there is no API access to the state, position or zoom of these areas. For example, adding a temporary layer and then deleting it leads to the Timeline's position to automatically focus the location of the new layer, without any way to set it back. Adding both `getters` and `setters` for these areas would make it easier to run scripts without disruption.

I'd love for these to be added, although I'm probably missing some:

- `editor.timeline.zoom`
- `editor.timeline.scroll`
- `editor.timeline.windowsize` : _The size of the editor area, so we can adjust how wide/high the area is_
- `editor.timeline.visible` : _Whether the timeline is visible or invisible (View > Timeline)`_
- `editor.advancedmode` : _Which mode is currently on (normal, editor focus or editor only)_
- `editor.palette.scroll`
- `editor.palette.zoom`
- `editor.palette.windowsize` : _The size of the palette area, so we can adjust how wide/high the area is_
- `editor.colorpicker.windowsize` : _The size of the colorpicker area, so we can adjust how wide/high the area is_
- `sprite.tabIndex` : _The order in which the sprites are shown at the top of the editor_
- `editor.previewwindow.zoom`
- `editor.previewwindow.scroll`
- `editor.previewwindow.visible` : `_Whether the preview window is enabled or disabled_
- `editor.previewwindow.play` : _Whether the preview window is playing or not_
- `editor.previewwindow.followcenter : _Whether the preview window is showing a static location of the sprite, or whether it is following the center of the main editor window_
- `editor.previewwindow.position` : _The position of the window on the screen(s)_
- `editor.previewwindow.size` : _The size of the preview window_

Names are placeholder ofcourse!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the existing scripting API for editor.Scroll and editor.Zoom, then inspect how the Timeline, palette, color picker, sprite tabs, and preview window expose their state. Decide which listed positions, sizes, visibility, zoom, and playback states can be consistently represented; done means the supported states have documented getter and setter behavior without disrupting scripts.

Written by the indexing model from the issue text.

Assessment

Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.