Create
This function creates a new emitter.
Syntax
- Emitter Create(number particlecount=10, Entity parent=NULL)
Parameters
- particlecount: - The number of particles that will be released during an emitters lifetime.
- parent: - The entity that the emitter is parented to.
Returns
This function returns newly created emitter.
Example
--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)
--Create an emitter
emitter = Emitter:Create(100)
while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end
Time:Update()
world:Update()
world:Render()
context:Sync()
end