mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-08-10 21:39:42 -04:00
Add more flexibility to draw-time object filtering
The `_drawThese` call now takes both a list of Drawable IDs for positive filtering and a filter function for negative filtering.
This commit is contained in:
parent
137e4a642e
commit
25d8148ec4
2 changed files with 24 additions and 7 deletions
src
|
@ -95,6 +95,12 @@ Drawable._effectConverter = {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @callback Drawable~idFilterFunc
|
||||
* @param {int} drawableID The ID to filter.
|
||||
* @return {bool} True if the ID passes the filter, otherwise false.
|
||||
*/
|
||||
|
||||
/**
|
||||
* An invalid Drawable ID which can be used to signify absence, etc.
|
||||
* @type {int}
|
||||
|
@ -107,6 +113,11 @@ Drawable.NONE = -1;
|
|||
*/
|
||||
Drawable.EFFECTS = Object.keys(Drawable._effectConverter);
|
||||
|
||||
/**
|
||||
* The available draw modes.
|
||||
* @readonly
|
||||
* @enum {string}
|
||||
*/
|
||||
Drawable.DRAW_MODE = {
|
||||
default: 'default',
|
||||
pick: 'pick'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue