Skip to content

Kaplay.Polygon

Modules

Comp

Types

polygonCompOpt
type polygonCompOpt = {
fill?: bool,
indices?: array<float>,
offset?: Kaplay.Vec2.t,
radius?: array<float>,
color?: array<Kaplay.Types.color>,
uv?: array<Kaplay.Vec2.t>,
texture?: Kaplay.Texture.t,
triangulate?: bool,
}
Fields
fill option < bool >
indices option < array >
offset option < Kaplay.Vec2.t >
radius option < array >
color option < array >
uv option < array >
texture option < Kaplay.Texture.t >
triangulate option < bool >

Values

addPolygonComponent
let addPolygon: (
Kaplay.Context.t,
array<Kaplay.Vec2.t>,
~options: polygonCompOpt=?,
) => Kaplay.Types.comp
Parameters
array < Kaplay.Vec2.t >
option < polygonCompOpt >
Return type
getColors
let getColors: T.t => option<array<Kaplay.Types.color>>
Parameters
T.t
Return type
option < array >
getOpacities
let getOpacities: T.t => option<array<float>>
Parameters
T.t
Return type
option < array >
getPts
let getPts: T.t => array<Kaplay.Vec2.t>
Parameters
T.t
Return type
array < Kaplay.Vec2.t >
getRadius
let getRadius: T.t => option<array<float>>
Parameters
T.t
Return type
option < array >
getTexture
let getTexture: T.t => option<Kaplay.Texture.t>
Parameters
T.t
Return type
option < Kaplay.Texture.t >
getUv
let getUv: T.t => option<array<Kaplay.Vec2.t>>
Parameters
T.t
Return type
option < array >
setColors
let setColors: (T.t, array<Kaplay.Types.color>) => unit
Parameters
T.t
array < Kaplay.Types.color >
Return type
unit
setOpacities
let setOpacities: (T.t, array<float>) => unit
Parameters
T.t
array < float >
Return type
unit
setPts
let setPts: (T.t, array<Kaplay.Vec2.t>) => unit
Parameters
T.t
array < Kaplay.Vec2.t >
Return type
unit
setRadius
let setRadius: (T.t, array<float>) => unit
Parameters
T.t
array < float >
Return type
unit
setTexture
let setTexture: (T.t, Kaplay.Texture.t) => unit
Parameters
T.t
Return type
unit
setUv
let setUv: (T.t, array<Kaplay.Vec2.t>) => unit
Parameters
T.t
array < Kaplay.Vec2.t >
Return type
unit