GetInterval

This function returns the current time interval, in milliseconds, between particle releases.

Syntax

Returns

This function returns a float containing the current release interval.

Remarks

This function is meant to be used in conjunction with SetFacingDirection, if the particle facing mode is set to billboarded then GetFacingDirection will be of no use. Remember that the view mode must be set to manual direction, see SetViewMode.

Example

--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
camera:Move(0,0,-3)

local interval = 1000

--Create an emitter
emitter = Emitter:Create(10)
emitter:SetEmissionVolume(0,0,0)
emitter:SetInterval(interval)

while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

Time:Update()
world:Update()
world:Render()

if (window:KeyDown(Key.Up)) then
interval = interval + 1000
emitter:SetInterval(interval)
elseif (window:KeyDown(Key.Down) and interval > 0) then
interval = interval - 1000
emitter:SetInterval(interval)
end

context:SetBlendMode(Blend.Alpha)
context:DrawText("Interval: " ..(emitter:GetInterval()/1000) .. " seconds.",2,2)

context:Sync()
end