A way to access widgets by ID / mainly canvas

Open
#90 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
lua
Domain
api

Research direction

Start with the Dialog():canvas widget and the existing onpaint event and Dialog:paint() flow described in the issue. Determine how widget IDs should expose a canvas context and how cached offscreen content interacts with resize redraws. Done means a widget can be accessed by ID, painted through its context, and still redraw correctly when resized.

Written by the indexing model from the issue text.

Description

feature

We should have a way to access widgets by ID. Mainly a canvas to paint some part of its surface. E.g.

local d = Dialog():canvas{ id=myCanvas }
local ctx = d.widgets.myCanvas.context
-- ... paint in the ctx ...

At the moment the only way to paint in the canvas is using the onpaint event and triggering that event through Dialog:paint() (but the onpaint should be a way to redraw the entire canvas in case of resize, we cached the surface on a offscreen bitmap).

Dominant language
No language data
Stars
310
Forks
68
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aseprite/api

All issues in aseprite/api

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.