Sprites.Media.Shader.Info

The Info window shows the image's pixel size and its layer count; width and height are two-way and resize the render. A shader image holds no stored pixels to reflow, only a size the layers render into, so changing width or height simply moves the size the render draws at. The layer count is a readout.

Sprites.Media.Shader.Info

Sprites.Media.Shader.Info.Window Void

Sprites.Media.Shader.Info.Window(visible, width, height, layers)

The Info window: the image's pixel size and its layer count. Width and height are number fields two-way bound to the document size the render draws at; changing one resizes the render, since a shader image holds no stored pixels to reflow, only a size the layers render into. The layer count is a readout. It shows while visible is true and docks to the top right of the stage.

InputTypeDescription
visibleSprites.Reactive.ValueShows the window while true.
widthSprites.Reactive.ValueThe two-way document width; changing it resizes the render.
heightSprites.Reactive.ValueThe two-way document height; changing it resizes the render.
layersSprites.Reactive.ValueThe layers list, read only here for its count.

Returns nothing.

const width = Sprites.Reactive.Value(512);
const height = Sprites.Reactive.Value(512);
const layers = Sprites.Reactive.Value([ Sprites.Media.Shader.NewLayer('Layer 1', ''), Sprites.Media.Shader.NewLayer('Layer 2', '') ]);
const visible = Sprites.Reactive.Value(false);
Sprites.Ui.Button.SetValue(visible, true, 'Show Info window');
Sprites.Media.Shader.Info.Window(visible, width, height, layers);
Show the Info window; the width and height fields are two-way and it reads the layers list for its count.