Skip to content
pixi-silk
GitHub repository
Function

islandShape

import { islandShape } from 'pixi-silk/ui/island';
function islandShape(
   edge: IslandEdge, 
   view: IslandRect, 
   u: number, 
   length: number, 
   depth: number, 
   radius: number, 
   flare: number, 
   options?: IslandShapeOptions
): IslandShape | null;

Outline of an island length long and depth deep, centred at u along the edge. The far corners get radius, the joins with the edge get concave flares of flare. Both shrink when the island is shallow, and the flares always meet the straight part of the sides, so the outline stays smooth at every depth. A full island ignores u and length and spans the edge. Returns null when depth is below a quarter unit.

Parameters#

ParameterType
edgeIslandEdge
viewIslandRect
unumber
lengthnumber
depthnumber
radiusnumber
flarenumber
optionsIslandShapeOptions

Returns#

IslandShape | null