ParticleSystem (Tiếng Việt)

Được dùng để tạo nên những hiệu ứng hay, như lửa chẳng hạn. Hệ các hạt được lập nên và vẽ trên màn hình bằng các hàm trong love.graphics. Bạn cũng cần cập nhật chúng trong callback có tên update(dt) thì mới thấy được sự biến đổi của các hạt được phát ra.

Constructor

love.graphics.newParticleSystem Creates a new ParticleSystem.

Hàm

Object:type Gets the type of the object as a string.
Object:typeOf Checks whether an object is of a certain type.
ParticleSystem:count Gets the amount of particles that are currently in the system.
ParticleSystem:getDirection Gets the direction of the particle emitter (in radians).
ParticleSystem:getOffsetX Get the x coordinate of the particle rotation offset.
ParticleSystem:getOffsetY Get the y coordinate of the particle rotation offset.
ParticleSystem:getPosition Gets the position of the emitter.
ParticleSystem:getSpread Gets the amount of directional spread of the particle emitter (in radians).
ParticleSystem:getX Gets the x-coordinate of the particle emitter's position.
ParticleSystem:getY Gets the y-coordinate of the particle emitter's position.
ParticleSystem:isActive Checks whether the particle system is actively emitting particles.
ParticleSystem:isEmpty Checks whether the particle system is empty of particles.
ParticleSystem:isFull Checks whether the particle system is full of particles.
ParticleSystem:pause Pauses the particle emitter.
ParticleSystem:reset Resets the particle emitter, removing any existing particles and resetting the lifetime counter.
ParticleSystem:setBufferSize Sets the size of the buffer (the max allowed amount of particles in the system).
ParticleSystem:setColor Sets the color of the image (color modulation needs to be activated for it to have any effect).
ParticleSystem:setColors Sets the colors to apply to the particle sprite.
ParticleSystem:setDirection Sets the direction the particles will be emitted in.
ParticleSystem:setEmissionRate Sets the amount of particles emitted per second.
ParticleSystem:setGravity Sets the gravity affecting the particles (acceleration along the y-axis).
ParticleSystem:setLifetime Sets how long the particle system should emit particles (if -1 then it emits particles forever).
ParticleSystem:setOffset Set the offset position which the particle sprite is rotated around.
ParticleSystem:setParticleLife Sets the life of the particles.
ParticleSystem:setPosition Sets the position of the emitter.
ParticleSystem:setRadialAcceleration Set the radial acceleration (away from the emitter).
ParticleSystem:setRotation Sets the rotation of the image upon particle creation (in radians).
ParticleSystem:setSize Sets the size of the particle (1.0 being normal size).
ParticleSystem:setSizeVariation Sets the degree of variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:setSizes Sets the sizes of the particle over its lifetime.
ParticleSystem:setSpeed Sets the speed of the particles.
ParticleSystem:setSpin Sets the spin of the sprite.
ParticleSystem:setSpinVariation Sets the degree of variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:setSpread Sets the amount of spread for the system.
ParticleSystem:setSprite Sets the image which is to be emitted.
ParticleSystem:setTangentialAcceleration Sets the tangential acceleration (acceleration perpendicular to the particle's direction).
ParticleSystem:start Starts the particle emitter.
ParticleSystem:stop Stops the particle emitter, resetting the lifetime counter.
ParticleSystem:update Updates the particle system; moving, creating and killing particles.

Kiểu cấp trên

Xem thêm


Ngôn ngữ khác

Personal tools