Sprites.Media.Shader.Tool
The shader editor's Tools window: a Tools group with the tool selector (only Move for now) and a Windows group whose buttons open the Layer, Layers, Parameters, Globals and Info panels. It reuses the sprite editor's shared tool parts and shows no tool controls of its own; the Move tool has its own window while selected, and each panel has its own window while its flag is true.
- Sprites.Media.Shader.Tool.Window
- Sprites.Media.Shader.Tool.Selector
- Sprites.Media.Shader.Tool.Windows
Sprites.Media.Shader.Tool.Window Void
Sprites.Media.Shader.Tool.Window(selectedToolName, layerVisible, layersVisible, paramsVisible, globalsVisible, infoVisible)
The Tools window: an always-present slim floating window docked to the stage's top left, with no close button and no resize. It holds the Tools group, the canvas tool selector, and the Windows group, the panel openers. selectedToolName is the chosen canvas tool; layerVisible, layersVisible, paramsVisible, globalsVisible and infoVisible are the five panel flags.
| Input | Type | Description |
|---|---|---|
selectedToolName | Sprites.Reactive.Value | The chosen canvas tool; the selector sets it, the editor reads it. |
layerVisible | Sprites.Reactive.Value | The Layer panel's visible flag; the Layer button sets it true. |
layersVisible | Sprites.Reactive.Value | The Layers panel's visible flag; the Layers button sets it true. |
paramsVisible | Sprites.Reactive.Value | The Parameters panel's visible flag; the Parameters button sets it true. |
globalsVisible | Sprites.Reactive.Value | The Globals panel's visible flag; the Globals button sets it true. |
infoVisible | Sprites.Reactive.Value | The Info panel's visible flag; the Info button sets it true. |
Returns nothing.
const selectedToolName = Sprites.Reactive.Value('move');
const layerVisible = Sprites.Reactive.Value(false);
const layersVisible = Sprites.Reactive.Value(false);
const paramsVisible = Sprites.Reactive.Value(false);
const globalsVisible = Sprites.Reactive.Value(false);
const infoVisible = Sprites.Reactive.Value(false);
// the live window docks to the body overlay, so here we show its two groups inline.
Sprites.Ui.Content.Area(() => {
Sprites.Media.Sprite.Tool.Labelled('Tools', () => {
Sprites.Media.Shader.Tool.Selector(selectedToolName);
});
Sprites.Media.Sprite.Tool.Labelled('Windows', () => {
Sprites.Media.Shader.Tool.Windows(layerVisible, layersVisible, paramsVisible, globalsVisible, infoVisible);
});
});
Sprites.Media.Shader.Tool.Selector Void
Sprites.Media.Shader.Tool.Selector(selectedToolName)
The canvas tool selector: one option per canvas tool. Only Move exists for now, panning and zooming the view. Picking sets selectedToolName, which the editor reads to choose which tool window shows. The panel windows open from the Windows group, so they are not here.
| Input | Type | Description |
|---|---|---|
selectedToolName | Sprites.Reactive.Value | The chosen canvas tool; picking an option sets it. |
Returns nothing.
const selectedToolName = Sprites.Reactive.Value('move');
Sprites.Media.Shader.Tool.Selector(selectedToolName);
Sprites.Media.Shader.Tool.Windows Void
Sprites.Media.Shader.Tool.Windows(layerVisible, layersVisible, paramsVisible, globalsVisible, infoVisible)
The Windows buttons: one secondary button per panel window, Layer, Layers, Parameters, Globals and Info, each opening its window on a click by setting its visible flag true. They turn nothing off; a panel window carries its own close button, and any number may be open at once.
| Input | Type | Description |
|---|---|---|
layerVisible | Sprites.Reactive.Value | The Layer panel's visible flag; the Layer button sets it true. |
layersVisible | Sprites.Reactive.Value | The Layers panel's visible flag; the Layers button sets it true. |
paramsVisible | Sprites.Reactive.Value | The Parameters panel's visible flag; the Parameters button sets it true. |
globalsVisible | Sprites.Reactive.Value | The Globals panel's visible flag; the Globals button sets it true. |
infoVisible | Sprites.Reactive.Value | The Info panel's visible flag; the Info button sets it true. |
Returns nothing.
const layerVisible = Sprites.Reactive.Value(false);
const layersVisible = Sprites.Reactive.Value(false);
const paramsVisible = Sprites.Reactive.Value(false);
const globalsVisible = Sprites.Reactive.Value(false);
const infoVisible = Sprites.Reactive.Value(false);
Sprites.Media.Shader.Tool.Windows(layerVisible, layersVisible, paramsVisible, globalsVisible, infoVisible);