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

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.

InputTypeDescription
visibleSprites.Reactive.ValueShows the window while true.
resetViewSprites.Reactive.ValueThe 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');
Show the Move window; its Reset runs the command, here counting clicks.