## **part_type_shape**
**将创建的粒子的形状设置为十四个内置形状之一**
#### **语法:**
part_type_shape(ind, shape);
| 参数 | 描述 |
| --- | --- |
| ind | 粒子类型ID. |
| shape | 内置形状选择. |
**返回:** N/A
#### **描述**
使用此功能,您可以设置以下常量用于粒子类型的精灵形状:
| 常量 | 描述 |
| --- | --- |
| pt_shape_pixel | 一个 1x1像素点(这是默认设置) |
| pt_shape_disk | 一个实心圆 |
| pt_shape_square | 一个实心正方形 |
| pt_shape_line | 一个8像素宽的水平线 |
| pt_shape_star | 一个实心五角星 |
| pt_shape_circle | 一个3像素轮廓的空心圆 |
| pt_shape_ring | 一个向内发光的圆圈(看起来像一个泡泡) |
| pt_shape_sphere | 一个中间向外发光的圆圈 |
| pt_shape_flare | 一个灼热的点(看起来像夜空中的一颗星星) |
| pt_shape_spark | 一个火花,就像一个多点淡出的星星 |
| pt_shape_explosion | 一个方形的烟雾,可以添加多种颜色来模拟爆炸 |
| pt_shape_cloud | 薄云,需要缩放和多个粒子来模拟云 |
| pt_shape_smoke | 爆炸效果的平滑版本,使用多个来创建一个烟云 |
| pt_shape_snow | 一个通用的雪花形状 |
![粒子类型-2](https://box.kancloud.cn/a3818cc7835d7aa9745b806210d4eeb4_468x353.png)
#### **举例:**
~~~
global.p1 = part_type_create();
part_type_shape(global.p1, pt_shape_square);
part_type_size(global.p1, 1, 3, 0, 0);
part_type_scale(global.p1, 1, 1);
part_type_colour1(global.p1, c_white);
part_type_alpha2(global.p1, 1, 0);
part_type_speed(global.p1, 2, 4, 0, 0);
part_type_direction(global.p1, 0, 180, 0, 0);
part_type_gravity(global.p1, 0.20, 270);
part_type_orientation(global.p1, 0, 0, 0, 0, 1);
part_type_blend(global.p1, 1);
part_type_life(global.p1, 15, 60);
~~~
以上代码将创建一个粒子索引放在"P1"中,并把其设置为正方形的形状,然后设置各种其他粒子属性。
- 简言
- 额外接口
- asset_get_index
- asset_get_type
- 粒子(PARTICLE)
- 简单粒子系统
- effect_create_below
- effect_create_above
- effect_clear
- ef_all
- 粒子系统
- 粒子系统的创建
- part_system_exists
- part_system_create
- part_system_create_layer
- part_system_get_layer
- part_system_layer
- part_system_clear
- part_system_depth
- part_system_position
- part_system_destroy
- part_particles_clear
- part_particles_count
- 系统绘图
- part_system_automatic_update
- part_system_automatic_draw
- part_system_update
- part_system_drawit
- part_system_draw_order
- 直接创建粒子
- part_particles_create
- part_particles_create_colour
- 粒子类型
- part_type_exists
- part_type_create
- part_type_destroy
- part_type_clear
- part_type_shape
- part_type_sprite
- part_type_size
- part_type_scale
- part_type_speed
- part_type_direction
- part_type_gravity
- part_type_orientation
- part_type_colour_mix
- part_type_colour_rgb
- part_type_colour_hsv
- part_type_colour1
- part_type_colour2
- part_type_colour3
- part_type_alpha1
- part_type_alpha2
- part_type_alpha3
- part_type_blend
- part_type_life
- part_type_step
- part_type_death
- 粒子发射器
- part_emitter_exists
- part_emitter_create
- part_emitter_clear
- part_emitter_region
- part_emitter_burst
- part_emitter_stream
- part_emitter_destroy
- part_emitter_destroy_all
- 数组(array)
- 数据结构(Data structures)
- 心得分享
- ds_exists
- ds_set_precision
- 网格(grid)
- ds_grid_create
- ds_grid_destroy
- ds_grid_width
- ds_grid_height
- ds_grid_resize
- ds_grid_clear
- ds_grid_set
- ds_grid_set_disk
- ds_grid_set_grid_region
- ds_grid_set_region
- ds_grid_shuffle
- ds_grid_sort
- ds_grid_get
- ds_grid_get_max
- ds_grid_get_mean
- ds_grid_get_min
- ds_grid_get_sum
- ds_grid_get_disk_max
- ds_grid_get_disk_mean
- ds_grid_get_disk_min
- ds_grid_get_disk_sum
- ds_grid_add
- ds_grid_add_region
- ds_grid_add_disk
- ds_grid_add_grid_region
- ds_grid_multiply
- ds_grid_multiply_disk
- ds_grid_multiply_region
- ds_grid_multiply_grid_region
- ds_grid_value_exists
- ds_grid_value_disk_exists
- ds_grid_value_x
- ds_grid_value_y
- ds_grid_value_disk_x
- ds_grid_value_disk_y
- ds_grid_copy
- ds_grid_read
- ds_grid_write
- 列表(list)
- 映射(map)
- 队列(Queues)
- 优先队列(Priority Queues)
- 堆栈(stack)