Creates a new [[ParticleSystem]].
{{newobjectnotice}}
== Function ==
=== Synopsis ===
<source lang="lua">
system = love.graphics.newParticleSystem( image, buffer )
</source>
=== Arguments ===
{{param|Image|image|The image to use.}}
{{param|number|buffer (1000)|The max number of particles at the same time.}}
=== Returns ===
{{param|ParticleSystem|system|A new ParticleSystem.}}

== Function ==
{{newin|[[0.9.1]]|091|type=variant}}
=== Synopsis ===
<source lang="lua">
system = love.graphics.newParticleSystem( texture, buffer )
</source>
=== Arguments ===
{{param|Texture|texture|The texture ([[Image]] or [[Canvas]]) to use.}}
{{param|number|buffer (1000)|The max number of particles at the same time.}}
=== Returns ===
{{param|ParticleSystem|system|A new ParticleSystem.}}

== Examples ==
=== Creation and usage of a particle system ===
You can use the [[:File:Love-game-logo-256x256.png|LÖVE logo]] as an example image.
<source lang="lua">
function love.load()
	local img = love.graphics.newImage('logo.png')

	psystem = love.graphics.newParticleSystem(img, 32)
	psystem:setParticleLifetime(2, 5) -- Particles live at least 2s and at most 5s.
	psystem:setEmissionRate(5)
	psystem:setSizeVariation(1)
	psystem:setLinearAcceleration(-20, -20, 20, 20) -- Random movement in all directions.
	psystem:setColors(1, 1, 1, 1, 1, 1, 1, 0) -- Fade to transparency.
end

function love.draw()
	-- Draw the particle system at the center of the game window.
	love.graphics.draw(psystem, love.graphics.getWidth() * 0.5, love.graphics.getHeight() * 0.5)
end

function love.update(dt)
	psystem:update(dt)
end
</source>

== See Also ==
* [[parent::love.graphics]]
* [[ParticleSystem:clone]]
* [[Constructs::ParticleSystem]]
[[Category:Functions]]
[[Sub-Category::Object Creation| ]]
{{#set:Description=Creates a new [[ParticleSystem]].}}
{{#set:Since=000}}
== Other Languages ==
{{i18n|love.graphics.newParticleSystem}}