getSpriteOutline(asset: string , frame?: number , RDP?: boolean , epsilon?: number ): Polygon
Create an outline in the form of a polygon from a sprite object
paramasset- The name of the sprite you want to generate an outline for
paramframe- The frame of the sprite that the outline should be taken from
paramRDP- Should the function return a simplified polygon
paramepsilon- The amount of the polygon that should be reduced
// Create a collider from the sprite
onLoad(() => {
add([
sprite("apple"),
area({shape: getSpriteOutline("apple")}),
pos(120, 80), // optional position
]);
});
returnsA polygon shape.
sincev4000.0