-
Notifications
You must be signed in to change notification settings - Fork 0
General functions
Chico edited this page Feb 21, 2019
·
6 revisions
luven.init( [ screenWidth ], [ screenHeight ], [ useCamera ] ) :
- Description
- Initialize the Luven lib, all parameters are optional to help simplicity.
- Params
- screenWidth : NUMBER : Positive
- Define the screen width for Luven's light calculations.
- love.graphics.getWidth() by default.
- screenHeight : NUMBER : Positive
- Define the screen height for Luven's light calculations.
- love.graphics.getWidth() by default (to have round lights, you can experiment).
- useCamera : BOOLEAN
- Allow to say to Luven that he should not use it's integrated camera.
- screenWidth : NUMBER : Positive
luven.setAmbientLightColor( color ) :
- Description
- Set the ambient light color, this value can be any color. rgb values have to be between 0 and 1.
- Params
- color : COLOR : { r, g, b }
- Define the ambient light color.
- { 0, 0, 0 } by default (complete dark night).
- color : COLOR : { r, g, b }
luven.sendCustomViewMatrix( viewMatrix ) :
- Description
- In case you're not using the integrated camera, your own camera have to provide a view matrix to the Luven shader with this function.
- Params
- viewMatrix : MAT4 : { e1_1, e1_2, .. e4_3, e4_4 }
- The integrated camera use the Transform new in LÖVE 11.0, they can provide matrix directly. Just put this in a table and send it to Luven. Or find another matematical way.
- viewMatrix : MAT4 : { e1_1, e1_2, .. e4_3, e4_4 }
luven.update( dt ) :
- Description
- Nothing more to say that, just call it in your
love.update()
.
- Nothing more to say that, just call it in your
- Params
- dt : NUMBER
- Deltatime
- dt : NUMBER
luven.drawBegin() :
- Description
- Work in pair with
luven.drawEnd()
. This call allow Luven to setup the shader and the camera transform.
- Work in pair with
luven.drawEnd() :
- Description
- Call after
luven.drawEnd()
... it's better.
- Call after
luven.dispose() :
- Description
- Let the Lua garbage collector do his job.
luven.getLightCount() :
- Description
- If you need to know how many lights are currently active.
- Return
- lightCount : NUMBER