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.newParticleSystemCreates a new ParticleSystem.

Hàm

Object:releaseImmediately destroys the object's Lua reference.
Object:typeGets the type of the object as a string.
Object:typeOfChecks whether an object is of a certain type.
ParticleSystem:cloneCreates an identical copy of the ParticleSystem in the stopped state.
ParticleSystem:countGets the amount of particles that are currently in the system.
ParticleSystem:emitEmits a burst of particles from the particle emitter.
ParticleSystem:getAreaSpreadGets the area-based spawn parameters for the particles.
ParticleSystem:getBufferSizeGets the maximum number of particles the ParticleSystem can have at once.
ParticleSystem:getColorsGets the colors to apply to the particle sprite.
ParticleSystem:getCountGets the number of particles that are currently in the system.
ParticleSystem:getDirectionGets the direction of the particle emitter (in radians).
ParticleSystem:getEmissionAreaGets the area-based spawn parameters for the particles.
ParticleSystem:getEmissionRateGets the amount of particles emitted per second.
ParticleSystem:getEmitterLifetimeGets how long the particle system will emit particles
ParticleSystem:getImageGets the image used for the particles.
ParticleSystem:getInsertModeGets the mode used when the ParticleSystem adds new particles.
ParticleSystem:getLinearAccelerationGets the linear acceleration (acceleration along the x and y axes) for particles.
ParticleSystem:getLinearDampingGets the amount of linear damping (constant deceleration) for particles.
ParticleSystem:getOffsetGets the particle image's draw offset.
ParticleSystem:getOffsetXGet the x coordinate of the particle rotation offset.
ParticleSystem:getOffsetYGet the y coordinate of the particle rotation offset.
ParticleSystem:getParticleLifetimeGets the lifetime of the particles.
ParticleSystem:getPositionGets the position of the emitter.
ParticleSystem:getQuadsGets a series of Quads used for the particle sprites.
ParticleSystem:getRadialAccelerationGets the radial acceleration (away from the emitter).
ParticleSystem:getRotationGets the rotation of the image upon particle creation (in radians).
ParticleSystem:getSizeVariationGets the amount of size variation.
ParticleSystem:getSizesGets the sizes of the particle over its lifetime.
ParticleSystem:getSpeedGets the speed of the particles.
ParticleSystem:getSpinGets the spin of the sprite.
ParticleSystem:getSpinVariationGets the amount of spin variation.
ParticleSystem:getSpreadGets the amount of directional spread of the particle emitter (in radians).
ParticleSystem:getTangentialAccelerationGets the tangential acceleration (acceleration perpendicular to the particle's direction).
ParticleSystem:getTextureGets the texture (Image or Canvas) used for the particles.
ParticleSystem:getXGets the x-coordinate of the particle emitter's position.
ParticleSystem:getYGets the y-coordinate of the particle emitter's position.
ParticleSystem:hasRelativeRotationGets whether particle angles and rotations are relative to their velocities.
ParticleSystem:isActiveChecks whether the particle system is actively emitting particles.
ParticleSystem:isEmptyChecks whether the particle system is empty of particles.
ParticleSystem:isFullChecks whether the particle system is full of particles.
ParticleSystem:isPausedChecks whether the particle system is paused.
ParticleSystem:isStoppedChecks whether the particle system is stopped.
ParticleSystem:moveToMoves the position of the emitter.
ParticleSystem:pausePauses the particle emitter.
ParticleSystem:resetResets the particle emitter, removing existing particles and resetting the lifetime counter.
ParticleSystem:setAreaSpreadSets area-based spawn parameters for the particles.
ParticleSystem:setBufferSizeSets the size of the buffer (the max allowed amount of particles in the system).
ParticleSystem:setColorSets the color of the image.
ParticleSystem:setColorsSets the colors to apply to the particle sprite.
ParticleSystem:setDirectionSets the direction the particles will be emitted in.
... further results

Kiểu cấp trên

Xem thêm


Ngôn ngữ khác