Kaplay.Sprite
Modules
Comp
Types
spriteCompOptions
type spriteCompOptions = { frame?: int, width?: float, height?: float, anim?: string, singular?: bool, flipX?: bool, flipY?: bool,}
Fields
frame option < int >
width option < float >
height option < float >
anim option < string >
singular option < bool >
flipX option < bool >
flipY option < bool >
Values
addSpriteComponent
let addSprite: ( Kaplay.Context.t, string, ~options: spriteCompOptions=?,) => Kaplay.Types.comp
Return type
getAnimFrame
let getAnimFrame: T.t => int
Parameters
T.t
Return type
int
getAnimSpeed
let getAnimSpeed: T.t => float
Parameters
T.t
Return type
float
getFlipX
let getFlipX: T.t => bool
Parameters
T.t
Return type
bool
getFrame
let getFrame: T.t => int
Parameters
T.t
Return type
int
getHeight
let getHeight: T.t => float
Parameters
T.t
Return type
float
getSprite
let getSprite: T.t => string
Parameters
T.t
Return type
string
getWidth
let getWidth: T.t => float
Parameters
T.t
Return type
float
numFrames
let numFrames: T.t => int
Parameters
T.t
Return type
int
play
let play: (T.t, string) => unit
Parameters
T.t
string
Return type
unit
setAnimFrame
let setAnimFrame: (T.t, int) => unit
Parameters
T.t
int
Return type
unit
setAnimSpeed
let setAnimSpeed: (T.t, float) => unit
Parameters
T.t
float
Return type
unit
setFlipX
let setFlipX: (T.t, bool) => unit
Parameters
T.t
bool
Return type
unit
setFrame
let setFrame: (T.t, int) => unit
Parameters
T.t
int
Return type
unit
setHeight
let setHeight: (T.t, float) => unit
Parameters
T.t
float
Return type
unit
setSprite
let setSprite: (T.t, string) => unit
Parameters
T.t
string
Return type
unit
setWidth
let setWidth: (T.t, float) => unit
Parameters
T.t
float
Return type
unit