Sprites.Media.Sprite.Move
The Move tool: pan and zoom the view over the sprite. Window is its own floating window, shown while the Move tool is selected, holding a Reset that recentres and refits the whole sprite. It carries no close button, since it must stay while Move is the current tool. The selector and the Tools window live in Sprites.Media.Sprite.Tool.
Sprites.Media.Sprite.Move.Window Void
Sprites.Media.Sprite.Move.Window(visible, resetView)
The Move tool's window: a floating panel holding a Reset button that recentres and refits the whole sprite. It shows while visible is true, which the editor binds to the Move tool being selected, and has no close button. resetView is the command Reset runs.
| Input | Type | Description |
|---|---|---|
visible | Sprites.Reactive.Value | Shows the window while true. |
resetView | Sprites.Reactive.Value | The command Reset runs. |
Returns nothing.
const visible = Sprites.Reactive.Value(false);
const count = Sprites.Reactive.Value(0);
const resetView = Sprites.Reactive.Reverse(() => {
const n = Sprites.Reactive.Freeze(count);
Sprites.Reactive.Set(count, n + 1);
});
Sprites.Ui.Button.SetValue(visible, true, 'Show Move window');
Sprites.Media.Sprite.Move.Window(visible, resetView);
Sprites.Ui.Dom.Text(' reset ', count, ' times');