Ruler: screen-edge rulers that follow the camera.
import { Ruler, niceStep, tickDivisions } from 'pixi-silk/ui/ruler';
Classes#
| Class | Description |
|---|
| Ruler | Top and left rulers for a Camera. Ticks and labels adapt to the zoom in 1, 2, 5 steps, and labels fade as steps change. The highlighted extent shows as a band with its edges labelled in the accent colour. A marker follows the pointer. |
Interfaces#
Type Aliases#
| Type Alias | Description |
|---|
| RulerSide | Which bar of a Ruler a point is on. corner is the square where both bars meet. |
| RulerTarget | What a Ruler highlights: objects, followed every frame through their axis-aligned bounds, or a fixed rectangle in world units. |
Functions#
| Function | Description |
|---|
| niceStep | The nice step (1, 2 or 5 times a power of ten) at or above min. Returns 1 for 0, negative or infinite input. |
| tickDivisions | Minor ticks per label step from niceStep: 4 when the step is 2 times a power of ten, else 5. |