Resource:Custom coronas: Difference between revisions
(Created page with "{{Resource page}} This resource lets You create some coronas. Not just your typical gtasa coronas that often times fail to appear. Since in this case corona Elements are crea...") |
No edit summary |
||
Line 86: | Line 86: | ||
==See Also== | ==See Also== | ||
[http://www.youtube.com/watch?v=5lruyY1fviQ A youtube video] | |||
[http://community.multitheftauto.com/index.php?p=resources&s=details&id=9558 Custom Coronas resource on MTA Community] | [http://community.multitheftauto.com/index.php?p=resources&s=details&id=9558 Custom Coronas resource on MTA Community] | ||
[http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D] | [http://www.html5rocks.com/en/tutorials/webgl/webgl_orthographic_3d WebGL Orthographic 3D] |
Revision as of 22:33, 1 July 2014
This resource lets You create some coronas. Not just your typical gtasa coronas that often times fail to appear. Since in this case corona Elements are created using dxDrawMaterialLine3d MTA function. I have changed the behaviour of the material to act as cylindrical billboards do.
Overview
It is easy to use, gives a few options to manage coronas.
The resource itself adds exported clientside functions:
Exported functions
createCorona
This function creates a shadered materialLine3d Corona.
bool exports.custom_coronas:createCorona(float posX,posY,posZ,size,int colorR,colorG,colorB,colorA)
Required Arguments
- float posX, posY, posZ: Position in world space.
- float size: Size of the corona.
- int colorR,colorG,colorB,colorA: Corona RGBA color emitted by the corona (0 - 255).
Returns
The function returns true if set successfully, false otherwise.
destroyCorona
This function destroys a shadered materialLine3d Corona element.
bool exports.custom_coronas:destroyCorona(element coronaElement)
Required Arguments
- element coronaElement: A previously declaired corona element.
Returns
The function returns true if set successfully, false otherwise.
setCoronaPosition
This function sets corona position.
bool exports.custom_coronas:setCoronaPosition(element coronaElement,float posX,posY,posZ)
Required Arguments
- element coronaElement: A previously declaired corona element.
- float posX, posY, posZ: Position in world space.
Returns
The function returns true if set successfully, false otherwise.
setCoroaColor
This function sets light color values.
bool exports.custom_coronas:setCoroaColor(element coronaElement,float colorR,colorG,colorB,colorA)
Required Arguments
- element coronaElement: A previously declaired light element.
- float colorR,colorG,colorB,colorA: Corona RGBA color emitted by the corona (0 - 255).
Returns
The function returns true if set successfully, false otherwise.
setCoronasDistFade
Set the Max distance of the corona to sync and the distance on which the it starts to fade out.
bool exports.custom_coronas:setCoronasDistFade(int MaxEffectFade,int MinEffectFade)
Required Arguments
- int MaxEffectFade: Set the Max distance of the corona to sync.(Must be greater than MinEffectFade).
- int MinEffectFade: Set the distance on which the corona starts to fade out.
Returns
The function returns true if set successfully, false otherwise.
Examples
local corTable = {} function addStuff() for i=1,30 do for j=1,30 do corTable[i] = createCorona(i * 7,j * 7,10,4,math.random()*255,math.random()*255,math.random()*255,1*255,false) end end end bindKey("r","down",addStuff)
This creates a 400 coronas near position (0,0,0)
Of course when you want to use these functions in your resources you have to include the custom_coronas resource in meta.