Particles Library

Particle Actions

For complex things in GameMaker Studio 2 you would normally have an object and then create instances of that object within the room. However, for graphics effects, this can be expensive as every instance comes with a "cost" in processing due to the variables it contains and the codes it has in the different events. You can reduce this cost by turning to tiles for drawing your graphics, or even using the asset layer in the room editor, but both of those are generally only used for drawing simple graphics that maintain the same position over time and have few special effects. However, there is one other option for drawing fast yet versatile graphics effects in your games, and that is to use particles.

Particles are graphic resources with certain properties which are defined within a particle system. These properties cannot be manipulated directly for individual particles, but are changed through the actions that are used to define the individual particle types within the system. They are very useful for creating beautiful and flashy effects (or subtle and discreet ones!) like explosions, decals, rain, snow, star fields and debris in a game without the CPU or GPU overhead that using instances and/or tiles and assets have.

The basic setup for a particle system follows three steps:

Although particles are an excellent tool for creating effects, they do come with certain restrictions and rules of good practice which need to be followed unless you want your game to have issues:

The following sections cover all actions for making your own particle systems:

创建粒子系统 创建粒子系统
销毁粒子系统 销毁粒子系统
清空粒子系统 清空粒子系统
暂停粒子系统 暂停粒子系统
更新粒子系统 更新粒子系统
创建粒子类型 创建粒子类型
销毁粒子类型 销毁粒子类型
设置粒子大小 设置粒子大小
设置粒子的精灵 设置粒子的精灵
设置粒子形状 设置粒子形状
设置粒子颜色 设置粒子颜色
设置粒子透明度 设置粒子透明度
设置粒子生命周期。 设置粒子生命周期。
设置粒子速度 设置粒子速度
设置的粒子方向 设置的粒子方向
设置粒子朝向。 设置粒子朝向。
设置粒子的重力。 设置粒子的重力。
设置次级粒子 设置次级粒子
喷发粒子 喷发粒子
创建粒子发射器 创建粒子发射器
销毁粒子发射器 销毁粒子发射器
发射粒子 发射粒子
设置发射器区域 设置发射器区域
产生特效 产生特效