Reference · Bodies as objects for your own three.js scene
PaintContexttype
What the caller gives the painter when it makes a body.
Import it
import type { PaintContext } from "@johnmorrisdotca/wakusei-planets/painter";
Definition
interface PaintContext {
look?: string;
invalidate?(): void;
ratio?: number;
maxTexture?: number;
}
Members
| Name | Type | Description |
|---|---|---|
look (optional) | string | undefined |
|
invalidate (optional) | (() => void) | undefined | Ask for a new draw: a sharper picture has arrived. |
ratio (optional) | number | undefined | Device pixels to a CSS pixel; default 1. |
maxTexture (optional) | number | undefined | The widest picture the GPU should be given, in pixels; default 2048. |
Examples
import type { PaintContext } from "@johnmorrisdotca/wakusei-planets/painter";
const context: PaintContext = { look: "painted", invalidate: () => undefined, ratio: 2 };
console.log(context.look);