Skip to content

1681-engine / index / solidSilhouette

Function: solidSilhouette() ​

ts
function solidSilhouette(texture, color?): Texture<TextureSource<any>> | null;

Defined in: src/core/silhouette.ts:24

texture's frame with every opaque pixel painted color (default white), alpha kept; made once per frame and colour and cached. Only for textures that are never repainted (atlas frames, snapshots): copy a live one first (TextureRegistry.snapshotInto) and paint the copy with fillSolid. Null when the frame cannot be read (no drawable source, an empty or rotated frame, a cross-origin image).

Parameters ​

ParameterTypeDefault value
textureTextureundefined
colornumber0xffffff

Returns ​

Texture<TextureSource<any>> | null

Released under the MIT License.