Lua:Callins: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
m update with new template params
Flozi (talk | contribs)
→Unsynced Only: ugly is ugly
Line 17: Line 17:


== Unsynced Only ==
== Unsynced Only ==
Inside these functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.
{{LuaCallin
|name = DrawGenesis
|params =
|return = none
|description = Don't render here. Spring draws the sky, the map, some water types, and unit selection.
}}
{{LuaCallin
{{LuaCallin
|name = DrawWorldPreUnit
|name = DrawWorldPreUnit
Line 24: Line 33:
}}
}}


{{LuaCallin
|name = DrawWorld
|params =
|return = none
|description = Spring draws command queues, 'map stuff', and map marks.
}}
{{LuaCallin
|name = DrawWorldShadow
|params =
|return = none
|description = ???
}}
{{LuaCallin
|name = DrawWorldReflection
|params =
|return = none
|description = ???
}}
{{LuaCallin
|name = DrawWorldRefraction
|params =
|return = none
|description = ???
}}
{{LuaCallin
|name = DrawScreen
|params =
|return = none
|description = ???
}}
{{LuaCallin
|name = DrawScreenEffects
|params = vsx, vsy
|return = none
|description = Where <code>vsx</code>, <code>vsy</code> are screen coords.
}}
{{LuaCallin
|name = DrawLoadScreen
|params =
|return = none
|description = {{new|95.0}} Only available to LuaIntro, draws custom load screens.
}}
{{LuaCallin
|name = DrawInMinimap
|params = sx, sy
|return = none
|description = Where <code>sx</code>, <code>sy</code> are values relative to the minimap's position and scale.
}}
=== Custom Object Rendering ===
For the following calls <code>drawMode</code> can be one of the following, <code>notDrawing = 0</code>, <code>normalDraw = 1</code>, <code>shadowDraw = 2</code>, <code>reflectionDraw = 3</code>, <code>refractionDraw = 4</code>.
{{LuaCallin
|name = DrawUnit
|params = unitID, drawMode
|return = none
|description = For custom rendering of units, [[Lua_UnitRendering|enabled here]].
}}
{{LuaCallin
|name = DrawFeature
|params = unitID, drawMode
|return = none
|description = For custom rendering of features.
}}
{{LuaCallin
|name = DrawShield
|params = unitID, weaponID, drawMode
|return = none
|description = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].
}}
{{LuaCallin
|name = DrawProjectile
|params = projectileID, drawMode
|return = none
|description = For custom rendering of weapon (& other) projectiles.
}}


== Synced - Unsynced Shared ==
== Synced - Unsynced Shared ==

Revision as of 22:10, 27 December 2013

Lua Callins

Common

addon.Initialize()
return: none

{{{info}}}


addon.Shutdown()
return: none

{{{info}}}


Unsynced Only

Inside these functions, you can use the Lua OpenGL Api to draw graphics.

addon.DrawGenesis()
return: none

{{{info}}}


addon.DrawWorldPreUnit()
return: none

{{{info}}}


addon.DrawWorld()
return: none

{{{info}}}


addon.DrawWorldShadow()
return: none

{{{info}}}


addon.DrawWorldReflection()
return: none

{{{info}}}


addon.DrawWorldRefraction()
return: none

{{{info}}}


addon.DrawScreen()
return: none

{{{info}}}


addon.DrawScreenEffects()
return: none

{{{info}}}


addon.DrawLoadScreen()
return: none

{{{info}}}


addon.DrawInMinimap()
return: none

{{{info}}}


Custom Object Rendering

For the following calls drawMode can be one of the following, notDrawing = 0, normalDraw = 1, shadowDraw = 2, reflectionDraw = 3, refractionDraw = 4.

addon.DrawUnit()
return: none

{{{info}}}


addon.DrawFeature()
return: none

{{{info}}}


addon.DrawShield()
return: none

{{{info}}}


addon.DrawProjectile()
return: none

{{{info}}}


Synced - Unsynced Shared

addon.PlayerChanged()
return: none

{{{info}}}


Synced Only

addon.AllowUnitCreation()
return: bool allow

{{{info}}}