1 /** 2 CPU-based 2D particle emitter. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.cpuparticles2d; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.node2d; 25 import godot.node; 26 import godot.gradient; 27 import godot.texture; 28 import godot.curve; 29 /** 30 CPU-based 2D particle emitter. 31 32 CPU-based 2D particle node used to create a variety of particle systems and effects. 33 See also $(D Particles2D), which provides the same functionality with hardware acceleration, but may not run on older devices. 34 $(B Note:) Unlike $(D Particles2D), the visibility rect is generated on-the-fly and doesn't need to be configured by the user. 35 */ 36 @GodotBaseClass struct CPUParticles2D 37 { 38 package(godot) enum string _GODOT_internal_name = "CPUParticles2D"; 39 public: 40 @nogc nothrow: 41 union { /** */ godot_object _godot_object; /** */ Node2D _GODOT_base; } 42 alias _GODOT_base this; 43 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 44 package(godot) __gshared bool _classBindingInitialized = false; 45 package(godot) static struct GDNativeClassBinding 46 { 47 __gshared: 48 @GodotName("_texture_changed") GodotMethod!(void) _textureChanged; 49 @GodotName("_update_render_thread") GodotMethod!(void) _updateRenderThread; 50 @GodotName("convert_from_particles") GodotMethod!(void, Node) convertFromParticles; 51 @GodotName("get_amount") GodotMethod!(long) getAmount; 52 @GodotName("get_color") GodotMethod!(Color) getColor; 53 @GodotName("get_color_ramp") GodotMethod!(Gradient) getColorRamp; 54 @GodotName("get_direction") GodotMethod!(Vector2) getDirection; 55 @GodotName("get_draw_order") GodotMethod!(CPUParticles2D.DrawOrder) getDrawOrder; 56 @GodotName("get_emission_colors") GodotMethod!(PoolColorArray) getEmissionColors; 57 @GodotName("get_emission_normals") GodotMethod!(PoolVector2Array) getEmissionNormals; 58 @GodotName("get_emission_points") GodotMethod!(PoolVector2Array) getEmissionPoints; 59 @GodotName("get_emission_rect_extents") GodotMethod!(Vector2) getEmissionRectExtents; 60 @GodotName("get_emission_shape") GodotMethod!(CPUParticles2D.EmissionShape) getEmissionShape; 61 @GodotName("get_emission_sphere_radius") GodotMethod!(double) getEmissionSphereRadius; 62 @GodotName("get_explosiveness_ratio") GodotMethod!(double) getExplosivenessRatio; 63 @GodotName("get_fixed_fps") GodotMethod!(long) getFixedFps; 64 @GodotName("get_fractional_delta") GodotMethod!(bool) getFractionalDelta; 65 @GodotName("get_gravity") GodotMethod!(Vector2) getGravity; 66 @GodotName("get_lifetime") GodotMethod!(double) getLifetime; 67 @GodotName("get_lifetime_randomness") GodotMethod!(double) getLifetimeRandomness; 68 @GodotName("get_normalmap") GodotMethod!(Texture) getNormalmap; 69 @GodotName("get_one_shot") GodotMethod!(bool) getOneShot; 70 @GodotName("get_param") GodotMethod!(double, long) getParam; 71 @GodotName("get_param_curve") GodotMethod!(Curve, long) getParamCurve; 72 @GodotName("get_param_randomness") GodotMethod!(double, long) getParamRandomness; 73 @GodotName("get_particle_flag") GodotMethod!(bool, long) getParticleFlag; 74 @GodotName("get_pre_process_time") GodotMethod!(double) getPreProcessTime; 75 @GodotName("get_randomness_ratio") GodotMethod!(double) getRandomnessRatio; 76 @GodotName("get_speed_scale") GodotMethod!(double) getSpeedScale; 77 @GodotName("get_spread") GodotMethod!(double) getSpread; 78 @GodotName("get_texture") GodotMethod!(Texture) getTexture; 79 @GodotName("get_use_local_coordinates") GodotMethod!(bool) getUseLocalCoordinates; 80 @GodotName("is_emitting") GodotMethod!(bool) isEmitting; 81 @GodotName("restart") GodotMethod!(void) restart; 82 @GodotName("set_amount") GodotMethod!(void, long) setAmount; 83 @GodotName("set_color") GodotMethod!(void, Color) setColor; 84 @GodotName("set_color_ramp") GodotMethod!(void, Gradient) setColorRamp; 85 @GodotName("set_direction") GodotMethod!(void, Vector2) setDirection; 86 @GodotName("set_draw_order") GodotMethod!(void, long) setDrawOrder; 87 @GodotName("set_emission_colors") GodotMethod!(void, PoolColorArray) setEmissionColors; 88 @GodotName("set_emission_normals") GodotMethod!(void, PoolVector2Array) setEmissionNormals; 89 @GodotName("set_emission_points") GodotMethod!(void, PoolVector2Array) setEmissionPoints; 90 @GodotName("set_emission_rect_extents") GodotMethod!(void, Vector2) setEmissionRectExtents; 91 @GodotName("set_emission_shape") GodotMethod!(void, long) setEmissionShape; 92 @GodotName("set_emission_sphere_radius") GodotMethod!(void, double) setEmissionSphereRadius; 93 @GodotName("set_emitting") GodotMethod!(void, bool) setEmitting; 94 @GodotName("set_explosiveness_ratio") GodotMethod!(void, double) setExplosivenessRatio; 95 @GodotName("set_fixed_fps") GodotMethod!(void, long) setFixedFps; 96 @GodotName("set_fractional_delta") GodotMethod!(void, bool) setFractionalDelta; 97 @GodotName("set_gravity") GodotMethod!(void, Vector2) setGravity; 98 @GodotName("set_lifetime") GodotMethod!(void, double) setLifetime; 99 @GodotName("set_lifetime_randomness") GodotMethod!(void, double) setLifetimeRandomness; 100 @GodotName("set_normalmap") GodotMethod!(void, Texture) setNormalmap; 101 @GodotName("set_one_shot") GodotMethod!(void, bool) setOneShot; 102 @GodotName("set_param") GodotMethod!(void, long, double) setParam; 103 @GodotName("set_param_curve") GodotMethod!(void, long, Curve) setParamCurve; 104 @GodotName("set_param_randomness") GodotMethod!(void, long, double) setParamRandomness; 105 @GodotName("set_particle_flag") GodotMethod!(void, long, bool) setParticleFlag; 106 @GodotName("set_pre_process_time") GodotMethod!(void, double) setPreProcessTime; 107 @GodotName("set_randomness_ratio") GodotMethod!(void, double) setRandomnessRatio; 108 @GodotName("set_speed_scale") GodotMethod!(void, double) setSpeedScale; 109 @GodotName("set_spread") GodotMethod!(void, double) setSpread; 110 @GodotName("set_texture") GodotMethod!(void, Texture) setTexture; 111 @GodotName("set_use_local_coordinates") GodotMethod!(void, bool) setUseLocalCoordinates; 112 } 113 /// 114 pragma(inline, true) bool opEquals(in CPUParticles2D other) const 115 { return _godot_object.ptr is other._godot_object.ptr; } 116 /// 117 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 118 { _godot_object.ptr = n; return null; } 119 /// 120 pragma(inline, true) bool opEquals(typeof(null) n) const 121 { return _godot_object.ptr is n; } 122 /// 123 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 124 mixin baseCasts; 125 /// Construct a new instance of CPUParticles2D. 126 /// Note: use `memnew!CPUParticles2D` instead. 127 static CPUParticles2D _new() 128 { 129 static godot_class_constructor constructor; 130 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("CPUParticles2D"); 131 if(constructor is null) return typeof(this).init; 132 return cast(CPUParticles2D)(constructor()); 133 } 134 @disable new(size_t s); 135 /// 136 enum Flags : int 137 { 138 /** 139 Use with $(D setParticleFlag) to set $(D flagAlignY). 140 */ 141 flagAlignYToVelocity = 0, 142 /** 143 Present for consistency with 3D particle nodes, not used in 2D. 144 */ 145 flagRotateY = 1, 146 /** 147 Present for consistency with 3D particle nodes, not used in 2D. 148 */ 149 flagDisableZ = 2, 150 /** 151 Represents the size of the $(D flags) enum. 152 */ 153 flagMax = 3, 154 } 155 /// 156 enum EmissionShape : int 157 { 158 /** 159 All particles will be emitted from a single point. 160 */ 161 emissionShapePoint = 0, 162 /** 163 Particles will be emitted on the surface of a sphere flattened to two dimensions. 164 */ 165 emissionShapeSphere = 1, 166 /** 167 Particles will be emitted in the area of a rectangle. 168 */ 169 emissionShapeRectangle = 2, 170 /** 171 Particles will be emitted at a position chosen randomly among $(D emissionPoints). Particle color will be modulated by $(D emissionColors). 172 */ 173 emissionShapePoints = 3, 174 /** 175 Particles will be emitted at a position chosen randomly among $(D emissionPoints). Particle velocity and rotation will be set based on $(D emissionNormals). Particle color will be modulated by $(D emissionColors). 176 */ 177 emissionShapeDirectedPoints = 4, 178 /** 179 Represents the size of the $(D emissionshape) enum. 180 */ 181 emissionShapeMax = 5, 182 } 183 /// 184 enum Parameter : int 185 { 186 /** 187 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set initial velocity properties. 188 */ 189 paramInitialLinearVelocity = 0, 190 /** 191 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set angular velocity properties. 192 */ 193 paramAngularVelocity = 1, 194 /** 195 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set orbital velocity properties. 196 */ 197 paramOrbitVelocity = 2, 198 /** 199 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set linear acceleration properties. 200 */ 201 paramLinearAccel = 3, 202 /** 203 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set radial acceleration properties. 204 */ 205 paramRadialAccel = 4, 206 /** 207 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set tangential acceleration properties. 208 */ 209 paramTangentialAccel = 5, 210 /** 211 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set damping properties. 212 */ 213 paramDamping = 6, 214 /** 215 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set angle properties. 216 */ 217 paramAngle = 7, 218 /** 219 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set scale properties. 220 */ 221 paramScale = 8, 222 /** 223 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set hue variation properties. 224 */ 225 paramHueVariation = 9, 226 /** 227 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set animation speed properties. 228 */ 229 paramAnimSpeed = 10, 230 /** 231 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set animation offset properties. 232 */ 233 paramAnimOffset = 11, 234 /** 235 Represents the size of the $(D parameter) enum. 236 */ 237 paramMax = 12, 238 } 239 /// 240 enum DrawOrder : int 241 { 242 /** 243 Particles are drawn in the order emitted. 244 */ 245 drawOrderIndex = 0, 246 /** 247 Particles are drawn in order of remaining lifetime. 248 */ 249 drawOrderLifetime = 1, 250 } 251 /// 252 enum Constants : int 253 { 254 flagAlignYToVelocity = 0, 255 emissionShapePoint = 0, 256 drawOrderIndex = 0, 257 paramInitialLinearVelocity = 0, 258 paramAngularVelocity = 1, 259 drawOrderLifetime = 1, 260 emissionShapeSphere = 1, 261 flagRotateY = 1, 262 emissionShapeRectangle = 2, 263 flagDisableZ = 2, 264 paramOrbitVelocity = 2, 265 flagMax = 3, 266 paramLinearAccel = 3, 267 emissionShapePoints = 3, 268 paramRadialAccel = 4, 269 emissionShapeDirectedPoints = 4, 270 paramTangentialAccel = 5, 271 emissionShapeMax = 5, 272 paramDamping = 6, 273 paramAngle = 7, 274 paramScale = 8, 275 paramHueVariation = 9, 276 paramAnimSpeed = 10, 277 paramAnimOffset = 11, 278 paramMax = 12, 279 } 280 /** 281 282 */ 283 void _textureChanged() 284 { 285 Array _GODOT_args = Array.make(); 286 String _GODOT_method_name = String("_texture_changed"); 287 this.callv(_GODOT_method_name, _GODOT_args); 288 } 289 /** 290 291 */ 292 void _updateRenderThread() 293 { 294 Array _GODOT_args = Array.make(); 295 String _GODOT_method_name = String("_update_render_thread"); 296 this.callv(_GODOT_method_name, _GODOT_args); 297 } 298 /** 299 Sets this node's properties to match a given $(D Particles2D) node with an assigned $(D ParticlesMaterial). 300 */ 301 void convertFromParticles(Node particles) 302 { 303 checkClassBinding!(typeof(this))(); 304 ptrcall!(void)(GDNativeClassBinding.convertFromParticles, _godot_object, particles); 305 } 306 /** 307 308 */ 309 long getAmount() const 310 { 311 checkClassBinding!(typeof(this))(); 312 return ptrcall!(long)(GDNativeClassBinding.getAmount, _godot_object); 313 } 314 /** 315 316 */ 317 Color getColor() const 318 { 319 checkClassBinding!(typeof(this))(); 320 return ptrcall!(Color)(GDNativeClassBinding.getColor, _godot_object); 321 } 322 /** 323 324 */ 325 Ref!Gradient getColorRamp() const 326 { 327 checkClassBinding!(typeof(this))(); 328 return ptrcall!(Gradient)(GDNativeClassBinding.getColorRamp, _godot_object); 329 } 330 /** 331 332 */ 333 Vector2 getDirection() const 334 { 335 checkClassBinding!(typeof(this))(); 336 return ptrcall!(Vector2)(GDNativeClassBinding.getDirection, _godot_object); 337 } 338 /** 339 340 */ 341 CPUParticles2D.DrawOrder getDrawOrder() const 342 { 343 checkClassBinding!(typeof(this))(); 344 return ptrcall!(CPUParticles2D.DrawOrder)(GDNativeClassBinding.getDrawOrder, _godot_object); 345 } 346 /** 347 348 */ 349 PoolColorArray getEmissionColors() const 350 { 351 checkClassBinding!(typeof(this))(); 352 return ptrcall!(PoolColorArray)(GDNativeClassBinding.getEmissionColors, _godot_object); 353 } 354 /** 355 356 */ 357 PoolVector2Array getEmissionNormals() const 358 { 359 checkClassBinding!(typeof(this))(); 360 return ptrcall!(PoolVector2Array)(GDNativeClassBinding.getEmissionNormals, _godot_object); 361 } 362 /** 363 364 */ 365 PoolVector2Array getEmissionPoints() const 366 { 367 checkClassBinding!(typeof(this))(); 368 return ptrcall!(PoolVector2Array)(GDNativeClassBinding.getEmissionPoints, _godot_object); 369 } 370 /** 371 372 */ 373 Vector2 getEmissionRectExtents() const 374 { 375 checkClassBinding!(typeof(this))(); 376 return ptrcall!(Vector2)(GDNativeClassBinding.getEmissionRectExtents, _godot_object); 377 } 378 /** 379 380 */ 381 CPUParticles2D.EmissionShape getEmissionShape() const 382 { 383 checkClassBinding!(typeof(this))(); 384 return ptrcall!(CPUParticles2D.EmissionShape)(GDNativeClassBinding.getEmissionShape, _godot_object); 385 } 386 /** 387 388 */ 389 double getEmissionSphereRadius() const 390 { 391 checkClassBinding!(typeof(this))(); 392 return ptrcall!(double)(GDNativeClassBinding.getEmissionSphereRadius, _godot_object); 393 } 394 /** 395 396 */ 397 double getExplosivenessRatio() const 398 { 399 checkClassBinding!(typeof(this))(); 400 return ptrcall!(double)(GDNativeClassBinding.getExplosivenessRatio, _godot_object); 401 } 402 /** 403 404 */ 405 long getFixedFps() const 406 { 407 checkClassBinding!(typeof(this))(); 408 return ptrcall!(long)(GDNativeClassBinding.getFixedFps, _godot_object); 409 } 410 /** 411 412 */ 413 bool getFractionalDelta() const 414 { 415 checkClassBinding!(typeof(this))(); 416 return ptrcall!(bool)(GDNativeClassBinding.getFractionalDelta, _godot_object); 417 } 418 /** 419 420 */ 421 Vector2 getGravity() const 422 { 423 checkClassBinding!(typeof(this))(); 424 return ptrcall!(Vector2)(GDNativeClassBinding.getGravity, _godot_object); 425 } 426 /** 427 428 */ 429 double getLifetime() const 430 { 431 checkClassBinding!(typeof(this))(); 432 return ptrcall!(double)(GDNativeClassBinding.getLifetime, _godot_object); 433 } 434 /** 435 436 */ 437 double getLifetimeRandomness() const 438 { 439 checkClassBinding!(typeof(this))(); 440 return ptrcall!(double)(GDNativeClassBinding.getLifetimeRandomness, _godot_object); 441 } 442 /** 443 444 */ 445 Ref!Texture getNormalmap() const 446 { 447 checkClassBinding!(typeof(this))(); 448 return ptrcall!(Texture)(GDNativeClassBinding.getNormalmap, _godot_object); 449 } 450 /** 451 452 */ 453 bool getOneShot() const 454 { 455 checkClassBinding!(typeof(this))(); 456 return ptrcall!(bool)(GDNativeClassBinding.getOneShot, _godot_object); 457 } 458 /** 459 Returns the base value of the parameter specified by $(D parameter). 460 */ 461 double getParam(in long param) const 462 { 463 checkClassBinding!(typeof(this))(); 464 return ptrcall!(double)(GDNativeClassBinding.getParam, _godot_object, param); 465 } 466 /** 467 Returns the $(D Curve) of the parameter specified by $(D parameter). 468 */ 469 Ref!Curve getParamCurve(in long param) const 470 { 471 checkClassBinding!(typeof(this))(); 472 return ptrcall!(Curve)(GDNativeClassBinding.getParamCurve, _godot_object, param); 473 } 474 /** 475 Returns the randomness factor of the parameter specified by $(D parameter). 476 */ 477 double getParamRandomness(in long param) const 478 { 479 checkClassBinding!(typeof(this))(); 480 return ptrcall!(double)(GDNativeClassBinding.getParamRandomness, _godot_object, param); 481 } 482 /** 483 Returns the enabled state of the given flag (see $(D flags) for options). 484 */ 485 bool getParticleFlag(in long flag) const 486 { 487 checkClassBinding!(typeof(this))(); 488 return ptrcall!(bool)(GDNativeClassBinding.getParticleFlag, _godot_object, flag); 489 } 490 /** 491 492 */ 493 double getPreProcessTime() const 494 { 495 checkClassBinding!(typeof(this))(); 496 return ptrcall!(double)(GDNativeClassBinding.getPreProcessTime, _godot_object); 497 } 498 /** 499 500 */ 501 double getRandomnessRatio() const 502 { 503 checkClassBinding!(typeof(this))(); 504 return ptrcall!(double)(GDNativeClassBinding.getRandomnessRatio, _godot_object); 505 } 506 /** 507 508 */ 509 double getSpeedScale() const 510 { 511 checkClassBinding!(typeof(this))(); 512 return ptrcall!(double)(GDNativeClassBinding.getSpeedScale, _godot_object); 513 } 514 /** 515 516 */ 517 double getSpread() const 518 { 519 checkClassBinding!(typeof(this))(); 520 return ptrcall!(double)(GDNativeClassBinding.getSpread, _godot_object); 521 } 522 /** 523 524 */ 525 Ref!Texture getTexture() const 526 { 527 checkClassBinding!(typeof(this))(); 528 return ptrcall!(Texture)(GDNativeClassBinding.getTexture, _godot_object); 529 } 530 /** 531 532 */ 533 bool getUseLocalCoordinates() const 534 { 535 checkClassBinding!(typeof(this))(); 536 return ptrcall!(bool)(GDNativeClassBinding.getUseLocalCoordinates, _godot_object); 537 } 538 /** 539 540 */ 541 bool isEmitting() const 542 { 543 checkClassBinding!(typeof(this))(); 544 return ptrcall!(bool)(GDNativeClassBinding.isEmitting, _godot_object); 545 } 546 /** 547 Restarts the particle emitter. 548 */ 549 void restart() 550 { 551 checkClassBinding!(typeof(this))(); 552 ptrcall!(void)(GDNativeClassBinding.restart, _godot_object); 553 } 554 /** 555 556 */ 557 void setAmount(in long amount) 558 { 559 checkClassBinding!(typeof(this))(); 560 ptrcall!(void)(GDNativeClassBinding.setAmount, _godot_object, amount); 561 } 562 /** 563 564 */ 565 void setColor(in Color color) 566 { 567 checkClassBinding!(typeof(this))(); 568 ptrcall!(void)(GDNativeClassBinding.setColor, _godot_object, color); 569 } 570 /** 571 572 */ 573 void setColorRamp(Gradient ramp) 574 { 575 checkClassBinding!(typeof(this))(); 576 ptrcall!(void)(GDNativeClassBinding.setColorRamp, _godot_object, ramp); 577 } 578 /** 579 580 */ 581 void setDirection(in Vector2 direction) 582 { 583 checkClassBinding!(typeof(this))(); 584 ptrcall!(void)(GDNativeClassBinding.setDirection, _godot_object, direction); 585 } 586 /** 587 588 */ 589 void setDrawOrder(in long order) 590 { 591 checkClassBinding!(typeof(this))(); 592 ptrcall!(void)(GDNativeClassBinding.setDrawOrder, _godot_object, order); 593 } 594 /** 595 596 */ 597 void setEmissionColors(in PoolColorArray array) 598 { 599 checkClassBinding!(typeof(this))(); 600 ptrcall!(void)(GDNativeClassBinding.setEmissionColors, _godot_object, array); 601 } 602 /** 603 604 */ 605 void setEmissionNormals(in PoolVector2Array array) 606 { 607 checkClassBinding!(typeof(this))(); 608 ptrcall!(void)(GDNativeClassBinding.setEmissionNormals, _godot_object, array); 609 } 610 /** 611 612 */ 613 void setEmissionPoints(in PoolVector2Array array) 614 { 615 checkClassBinding!(typeof(this))(); 616 ptrcall!(void)(GDNativeClassBinding.setEmissionPoints, _godot_object, array); 617 } 618 /** 619 620 */ 621 void setEmissionRectExtents(in Vector2 extents) 622 { 623 checkClassBinding!(typeof(this))(); 624 ptrcall!(void)(GDNativeClassBinding.setEmissionRectExtents, _godot_object, extents); 625 } 626 /** 627 628 */ 629 void setEmissionShape(in long shape) 630 { 631 checkClassBinding!(typeof(this))(); 632 ptrcall!(void)(GDNativeClassBinding.setEmissionShape, _godot_object, shape); 633 } 634 /** 635 636 */ 637 void setEmissionSphereRadius(in double radius) 638 { 639 checkClassBinding!(typeof(this))(); 640 ptrcall!(void)(GDNativeClassBinding.setEmissionSphereRadius, _godot_object, radius); 641 } 642 /** 643 644 */ 645 void setEmitting(in bool emitting) 646 { 647 checkClassBinding!(typeof(this))(); 648 ptrcall!(void)(GDNativeClassBinding.setEmitting, _godot_object, emitting); 649 } 650 /** 651 652 */ 653 void setExplosivenessRatio(in double ratio) 654 { 655 checkClassBinding!(typeof(this))(); 656 ptrcall!(void)(GDNativeClassBinding.setExplosivenessRatio, _godot_object, ratio); 657 } 658 /** 659 660 */ 661 void setFixedFps(in long fps) 662 { 663 checkClassBinding!(typeof(this))(); 664 ptrcall!(void)(GDNativeClassBinding.setFixedFps, _godot_object, fps); 665 } 666 /** 667 668 */ 669 void setFractionalDelta(in bool enable) 670 { 671 checkClassBinding!(typeof(this))(); 672 ptrcall!(void)(GDNativeClassBinding.setFractionalDelta, _godot_object, enable); 673 } 674 /** 675 676 */ 677 void setGravity(in Vector2 accel_vec) 678 { 679 checkClassBinding!(typeof(this))(); 680 ptrcall!(void)(GDNativeClassBinding.setGravity, _godot_object, accel_vec); 681 } 682 /** 683 684 */ 685 void setLifetime(in double secs) 686 { 687 checkClassBinding!(typeof(this))(); 688 ptrcall!(void)(GDNativeClassBinding.setLifetime, _godot_object, secs); 689 } 690 /** 691 692 */ 693 void setLifetimeRandomness(in double random) 694 { 695 checkClassBinding!(typeof(this))(); 696 ptrcall!(void)(GDNativeClassBinding.setLifetimeRandomness, _godot_object, random); 697 } 698 /** 699 700 */ 701 void setNormalmap(Texture normalmap) 702 { 703 checkClassBinding!(typeof(this))(); 704 ptrcall!(void)(GDNativeClassBinding.setNormalmap, _godot_object, normalmap); 705 } 706 /** 707 708 */ 709 void setOneShot(in bool enable) 710 { 711 checkClassBinding!(typeof(this))(); 712 ptrcall!(void)(GDNativeClassBinding.setOneShot, _godot_object, enable); 713 } 714 /** 715 Sets the base value of the parameter specified by $(D parameter). 716 */ 717 void setParam(in long param, in double value) 718 { 719 checkClassBinding!(typeof(this))(); 720 ptrcall!(void)(GDNativeClassBinding.setParam, _godot_object, param, value); 721 } 722 /** 723 Sets the $(D Curve) of the parameter specified by $(D parameter). 724 */ 725 void setParamCurve(in long param, Curve curve) 726 { 727 checkClassBinding!(typeof(this))(); 728 ptrcall!(void)(GDNativeClassBinding.setParamCurve, _godot_object, param, curve); 729 } 730 /** 731 Sets the randomness factor of the parameter specified by $(D parameter). 732 */ 733 void setParamRandomness(in long param, in double randomness) 734 { 735 checkClassBinding!(typeof(this))(); 736 ptrcall!(void)(GDNativeClassBinding.setParamRandomness, _godot_object, param, randomness); 737 } 738 /** 739 Enables or disables the given flag (see $(D flags) for options). 740 */ 741 void setParticleFlag(in long flag, in bool enable) 742 { 743 checkClassBinding!(typeof(this))(); 744 ptrcall!(void)(GDNativeClassBinding.setParticleFlag, _godot_object, flag, enable); 745 } 746 /** 747 748 */ 749 void setPreProcessTime(in double secs) 750 { 751 checkClassBinding!(typeof(this))(); 752 ptrcall!(void)(GDNativeClassBinding.setPreProcessTime, _godot_object, secs); 753 } 754 /** 755 756 */ 757 void setRandomnessRatio(in double ratio) 758 { 759 checkClassBinding!(typeof(this))(); 760 ptrcall!(void)(GDNativeClassBinding.setRandomnessRatio, _godot_object, ratio); 761 } 762 /** 763 764 */ 765 void setSpeedScale(in double scale) 766 { 767 checkClassBinding!(typeof(this))(); 768 ptrcall!(void)(GDNativeClassBinding.setSpeedScale, _godot_object, scale); 769 } 770 /** 771 772 */ 773 void setSpread(in double degrees) 774 { 775 checkClassBinding!(typeof(this))(); 776 ptrcall!(void)(GDNativeClassBinding.setSpread, _godot_object, degrees); 777 } 778 /** 779 780 */ 781 void setTexture(Texture texture) 782 { 783 checkClassBinding!(typeof(this))(); 784 ptrcall!(void)(GDNativeClassBinding.setTexture, _godot_object, texture); 785 } 786 /** 787 788 */ 789 void setUseLocalCoordinates(in bool enable) 790 { 791 checkClassBinding!(typeof(this))(); 792 ptrcall!(void)(GDNativeClassBinding.setUseLocalCoordinates, _godot_object, enable); 793 } 794 /** 795 The number of particles emitted in one emission cycle (corresponding to the $(D lifetime)). 796 $(B Note:) Changing $(D amount) will reset the particle emission, therefore removing all particles that were already emitted before changing $(D amount). 797 */ 798 @property long amount() 799 { 800 return getAmount(); 801 } 802 /// ditto 803 @property void amount(long v) 804 { 805 setAmount(v); 806 } 807 /** 808 Initial rotation applied to each particle, in degrees. 809 */ 810 @property double angle() 811 { 812 return getParam(7); 813 } 814 /// ditto 815 @property void angle(double v) 816 { 817 setParam(7, v); 818 } 819 /** 820 Each particle's rotation will be animated along this $(D Curve). 821 */ 822 @property Curve angleCurve() 823 { 824 return getParamCurve(7); 825 } 826 /// ditto 827 @property void angleCurve(Curve v) 828 { 829 setParamCurve(7, v); 830 } 831 /** 832 Rotation randomness ratio. 833 */ 834 @property double angleRandom() 835 { 836 return getParamRandomness(7); 837 } 838 /// ditto 839 @property void angleRandom(double v) 840 { 841 setParamRandomness(7, v); 842 } 843 /** 844 Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. 845 */ 846 @property double angularVelocity() 847 { 848 return getParam(1); 849 } 850 /// ditto 851 @property void angularVelocity(double v) 852 { 853 setParam(1, v); 854 } 855 /** 856 Each particle's angular velocity will vary along this $(D Curve). 857 */ 858 @property Curve angularVelocityCurve() 859 { 860 return getParamCurve(1); 861 } 862 /// ditto 863 @property void angularVelocityCurve(Curve v) 864 { 865 setParamCurve(1, v); 866 } 867 /** 868 Angular velocity randomness ratio. 869 */ 870 @property double angularVelocityRandom() 871 { 872 return getParamRandomness(1); 873 } 874 /// ditto 875 @property void angularVelocityRandom(double v) 876 { 877 setParamRandomness(1, v); 878 } 879 /** 880 Particle animation offset. 881 */ 882 @property double animOffset() 883 { 884 return getParam(11); 885 } 886 /// ditto 887 @property void animOffset(double v) 888 { 889 setParam(11, v); 890 } 891 /** 892 Each particle's animation offset will vary along this $(D Curve). 893 */ 894 @property Curve animOffsetCurve() 895 { 896 return getParamCurve(11); 897 } 898 /// ditto 899 @property void animOffsetCurve(Curve v) 900 { 901 setParamCurve(11, v); 902 } 903 /** 904 Animation offset randomness ratio. 905 */ 906 @property double animOffsetRandom() 907 { 908 return getParamRandomness(11); 909 } 910 /// ditto 911 @property void animOffsetRandom(double v) 912 { 913 setParamRandomness(11, v); 914 } 915 /** 916 Particle animation speed. 917 */ 918 @property double animSpeed() 919 { 920 return getParam(10); 921 } 922 /// ditto 923 @property void animSpeed(double v) 924 { 925 setParam(10, v); 926 } 927 /** 928 Each particle's animation speed will vary along this $(D Curve). 929 */ 930 @property Curve animSpeedCurve() 931 { 932 return getParamCurve(10); 933 } 934 /// ditto 935 @property void animSpeedCurve(Curve v) 936 { 937 setParamCurve(10, v); 938 } 939 /** 940 Animation speed randomness ratio. 941 */ 942 @property double animSpeedRandom() 943 { 944 return getParamRandomness(10); 945 } 946 /// ditto 947 @property void animSpeedRandom(double v) 948 { 949 setParamRandomness(10, v); 950 } 951 /** 952 Each particle's initial color. If $(D texture) is defined, it will be multiplied by this color. 953 */ 954 @property Color color() 955 { 956 return getColor(); 957 } 958 /// ditto 959 @property void color(Color v) 960 { 961 setColor(v); 962 } 963 /** 964 Each particle's color will vary along this $(D Gradient). 965 */ 966 @property Gradient colorRamp() 967 { 968 return getColorRamp(); 969 } 970 /// ditto 971 @property void colorRamp(Gradient v) 972 { 973 setColorRamp(v); 974 } 975 /** 976 The rate at which particles lose velocity. 977 */ 978 @property double damping() 979 { 980 return getParam(6); 981 } 982 /// ditto 983 @property void damping(double v) 984 { 985 setParam(6, v); 986 } 987 /** 988 Damping will vary along this $(D Curve). 989 */ 990 @property Curve dampingCurve() 991 { 992 return getParamCurve(6); 993 } 994 /// ditto 995 @property void dampingCurve(Curve v) 996 { 997 setParamCurve(6, v); 998 } 999 /** 1000 Damping randomness ratio. 1001 */ 1002 @property double dampingRandom() 1003 { 1004 return getParamRandomness(6); 1005 } 1006 /// ditto 1007 @property void dampingRandom(double v) 1008 { 1009 setParamRandomness(6, v); 1010 } 1011 /** 1012 Unit vector specifying the particles' emission direction. 1013 */ 1014 @property Vector2 direction() 1015 { 1016 return getDirection(); 1017 } 1018 /// ditto 1019 @property void direction(Vector2 v) 1020 { 1021 setDirection(v); 1022 } 1023 /** 1024 Particle draw order. Uses $(D draworder) values. 1025 */ 1026 @property CPUParticles2D.DrawOrder drawOrder() 1027 { 1028 return getDrawOrder(); 1029 } 1030 /// ditto 1031 @property void drawOrder(long v) 1032 { 1033 setDrawOrder(v); 1034 } 1035 /** 1036 Sets the $(D Color)s to modulate particles by when using $(D constant EMISSION_SHAPE_POINTS) or $(D constant EMISSION_SHAPE_DIRECTED_POINTS). 1037 */ 1038 @property PoolColorArray emissionColors() 1039 { 1040 return getEmissionColors(); 1041 } 1042 /// ditto 1043 @property void emissionColors(PoolColorArray v) 1044 { 1045 setEmissionColors(v); 1046 } 1047 /** 1048 Sets the direction the particles will be emitted in when using $(D constant EMISSION_SHAPE_DIRECTED_POINTS). 1049 */ 1050 @property PoolVector2Array emissionNormals() 1051 { 1052 return getEmissionNormals(); 1053 } 1054 /// ditto 1055 @property void emissionNormals(PoolVector2Array v) 1056 { 1057 setEmissionNormals(v); 1058 } 1059 /** 1060 Sets the initial positions to spawn particles when using $(D constant EMISSION_SHAPE_POINTS) or $(D constant EMISSION_SHAPE_DIRECTED_POINTS). 1061 */ 1062 @property PoolVector2Array emissionPoints() 1063 { 1064 return getEmissionPoints(); 1065 } 1066 /// ditto 1067 @property void emissionPoints(PoolVector2Array v) 1068 { 1069 setEmissionPoints(v); 1070 } 1071 /** 1072 The rectangle's extents if $(D emissionShape) is set to $(D constant EMISSION_SHAPE_RECTANGLE). 1073 */ 1074 @property Vector2 emissionRectExtents() 1075 { 1076 return getEmissionRectExtents(); 1077 } 1078 /// ditto 1079 @property void emissionRectExtents(Vector2 v) 1080 { 1081 setEmissionRectExtents(v); 1082 } 1083 /** 1084 Particles will be emitted inside this region. See $(D emissionshape) for possible values. 1085 */ 1086 @property CPUParticles2D.EmissionShape emissionShape() 1087 { 1088 return getEmissionShape(); 1089 } 1090 /// ditto 1091 @property void emissionShape(long v) 1092 { 1093 setEmissionShape(v); 1094 } 1095 /** 1096 The sphere's radius if $(D emissionShape) is set to $(D constant EMISSION_SHAPE_SPHERE). 1097 */ 1098 @property double emissionSphereRadius() 1099 { 1100 return getEmissionSphereRadius(); 1101 } 1102 /// ditto 1103 @property void emissionSphereRadius(double v) 1104 { 1105 setEmissionSphereRadius(v); 1106 } 1107 /** 1108 If `true`, particles are being emitted. 1109 */ 1110 @property bool emitting() 1111 { 1112 return isEmitting(); 1113 } 1114 /// ditto 1115 @property void emitting(bool v) 1116 { 1117 setEmitting(v); 1118 } 1119 /** 1120 How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. 1121 */ 1122 @property double explosiveness() 1123 { 1124 return getExplosivenessRatio(); 1125 } 1126 /// ditto 1127 @property void explosiveness(double v) 1128 { 1129 setExplosivenessRatio(v); 1130 } 1131 /** 1132 The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. 1133 */ 1134 @property long fixedFps() 1135 { 1136 return getFixedFps(); 1137 } 1138 /// ditto 1139 @property void fixedFps(long v) 1140 { 1141 setFixedFps(v); 1142 } 1143 /** 1144 Align Y axis of particle with the direction of its velocity. 1145 */ 1146 @property bool flagAlignY() 1147 { 1148 return getParticleFlag(0); 1149 } 1150 /// ditto 1151 @property void flagAlignY(bool v) 1152 { 1153 setParticleFlag(0, v); 1154 } 1155 /** 1156 If `true`, results in fractional delta calculation which has a smoother particles display effect. 1157 */ 1158 @property bool fractDelta() 1159 { 1160 return getFractionalDelta(); 1161 } 1162 /// ditto 1163 @property void fractDelta(bool v) 1164 { 1165 setFractionalDelta(v); 1166 } 1167 /** 1168 Gravity applied to every particle. 1169 */ 1170 @property Vector2 gravity() 1171 { 1172 return getGravity(); 1173 } 1174 /// ditto 1175 @property void gravity(Vector2 v) 1176 { 1177 setGravity(v); 1178 } 1179 /** 1180 Initial hue variation applied to each particle. 1181 */ 1182 @property double hueVariation() 1183 { 1184 return getParam(9); 1185 } 1186 /// ditto 1187 @property void hueVariation(double v) 1188 { 1189 setParam(9, v); 1190 } 1191 /** 1192 Each particle's hue will vary along this $(D Curve). 1193 */ 1194 @property Curve hueVariationCurve() 1195 { 1196 return getParamCurve(9); 1197 } 1198 /// ditto 1199 @property void hueVariationCurve(Curve v) 1200 { 1201 setParamCurve(9, v); 1202 } 1203 /** 1204 Hue variation randomness ratio. 1205 */ 1206 @property double hueVariationRandom() 1207 { 1208 return getParamRandomness(9); 1209 } 1210 /// ditto 1211 @property void hueVariationRandom(double v) 1212 { 1213 setParamRandomness(9, v); 1214 } 1215 /** 1216 Initial velocity magnitude for each particle. Direction comes from $(D spread) and the node's orientation. 1217 */ 1218 @property double initialVelocity() 1219 { 1220 return getParam(0); 1221 } 1222 /// ditto 1223 @property void initialVelocity(double v) 1224 { 1225 setParam(0, v); 1226 } 1227 /** 1228 Initial velocity randomness ratio. 1229 */ 1230 @property double initialVelocityRandom() 1231 { 1232 return getParamRandomness(0); 1233 } 1234 /// ditto 1235 @property void initialVelocityRandom(double v) 1236 { 1237 setParamRandomness(0, v); 1238 } 1239 /** 1240 The amount of time each particle will exist (in seconds). 1241 */ 1242 @property double lifetime() 1243 { 1244 return getLifetime(); 1245 } 1246 /// ditto 1247 @property void lifetime(double v) 1248 { 1249 setLifetime(v); 1250 } 1251 /** 1252 Particle lifetime randomness ratio. 1253 */ 1254 @property double lifetimeRandomness() 1255 { 1256 return getLifetimeRandomness(); 1257 } 1258 /// ditto 1259 @property void lifetimeRandomness(double v) 1260 { 1261 setLifetimeRandomness(v); 1262 } 1263 /** 1264 Linear acceleration applied to each particle in the direction of motion. 1265 */ 1266 @property double linearAccel() 1267 { 1268 return getParam(3); 1269 } 1270 /// ditto 1271 @property void linearAccel(double v) 1272 { 1273 setParam(3, v); 1274 } 1275 /** 1276 Each particle's linear acceleration will vary along this $(D Curve). 1277 */ 1278 @property Curve linearAccelCurve() 1279 { 1280 return getParamCurve(3); 1281 } 1282 /// ditto 1283 @property void linearAccelCurve(Curve v) 1284 { 1285 setParamCurve(3, v); 1286 } 1287 /** 1288 Linear acceleration randomness ratio. 1289 */ 1290 @property double linearAccelRandom() 1291 { 1292 return getParamRandomness(3); 1293 } 1294 /// ditto 1295 @property void linearAccelRandom(double v) 1296 { 1297 setParamRandomness(3, v); 1298 } 1299 /** 1300 If `true`, particles use the parent node's coordinate space. If `false`, they use global coordinates. 1301 */ 1302 @property bool localCoords() 1303 { 1304 return getUseLocalCoordinates(); 1305 } 1306 /// ditto 1307 @property void localCoords(bool v) 1308 { 1309 setUseLocalCoordinates(v); 1310 } 1311 /** 1312 Normal map to be used for the $(D texture) property. 1313 $(B Note:) Godot expects the normal map to use X+, Y-, and Z+ coordinates. See $(D url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates)this page$(D /url) for a comparison of normal map coordinates expected by popular engines. 1314 */ 1315 @property Texture normalmap() 1316 { 1317 return getNormalmap(); 1318 } 1319 /// ditto 1320 @property void normalmap(Texture v) 1321 { 1322 setNormalmap(v); 1323 } 1324 /** 1325 If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. 1326 */ 1327 @property bool oneShot() 1328 { 1329 return getOneShot(); 1330 } 1331 /// ditto 1332 @property void oneShot(bool v) 1333 { 1334 setOneShot(v); 1335 } 1336 /** 1337 Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. 1338 */ 1339 @property double orbitVelocity() 1340 { 1341 return getParam(2); 1342 } 1343 /// ditto 1344 @property void orbitVelocity(double v) 1345 { 1346 setParam(2, v); 1347 } 1348 /** 1349 Each particle's orbital velocity will vary along this $(D Curve). 1350 */ 1351 @property Curve orbitVelocityCurve() 1352 { 1353 return getParamCurve(2); 1354 } 1355 /// ditto 1356 @property void orbitVelocityCurve(Curve v) 1357 { 1358 setParamCurve(2, v); 1359 } 1360 /** 1361 Orbital velocity randomness ratio. 1362 */ 1363 @property double orbitVelocityRandom() 1364 { 1365 return getParamRandomness(2); 1366 } 1367 /// ditto 1368 @property void orbitVelocityRandom(double v) 1369 { 1370 setParamRandomness(2, v); 1371 } 1372 /** 1373 Particle system starts as if it had already run for this many seconds. 1374 */ 1375 @property double preprocess() 1376 { 1377 return getPreProcessTime(); 1378 } 1379 /// ditto 1380 @property void preprocess(double v) 1381 { 1382 setPreProcessTime(v); 1383 } 1384 /** 1385 Radial acceleration applied to each particle. Makes particle accelerate away from origin. 1386 */ 1387 @property double radialAccel() 1388 { 1389 return getParam(4); 1390 } 1391 /// ditto 1392 @property void radialAccel(double v) 1393 { 1394 setParam(4, v); 1395 } 1396 /** 1397 Each particle's radial acceleration will vary along this $(D Curve). 1398 */ 1399 @property Curve radialAccelCurve() 1400 { 1401 return getParamCurve(4); 1402 } 1403 /// ditto 1404 @property void radialAccelCurve(Curve v) 1405 { 1406 setParamCurve(4, v); 1407 } 1408 /** 1409 Radial acceleration randomness ratio. 1410 */ 1411 @property double radialAccelRandom() 1412 { 1413 return getParamRandomness(4); 1414 } 1415 /// ditto 1416 @property void radialAccelRandom(double v) 1417 { 1418 setParamRandomness(4, v); 1419 } 1420 /** 1421 Emission lifetime randomness ratio. 1422 */ 1423 @property double randomness() 1424 { 1425 return getRandomnessRatio(); 1426 } 1427 /// ditto 1428 @property void randomness(double v) 1429 { 1430 setRandomnessRatio(v); 1431 } 1432 /** 1433 Initial scale applied to each particle. 1434 */ 1435 @property double scaleAmount() 1436 { 1437 return getParam(8); 1438 } 1439 /// ditto 1440 @property void scaleAmount(double v) 1441 { 1442 setParam(8, v); 1443 } 1444 /** 1445 Each particle's scale will vary along this $(D Curve). 1446 */ 1447 @property Curve scaleAmountCurve() 1448 { 1449 return getParamCurve(8); 1450 } 1451 /// ditto 1452 @property void scaleAmountCurve(Curve v) 1453 { 1454 setParamCurve(8, v); 1455 } 1456 /** 1457 Scale randomness ratio. 1458 */ 1459 @property double scaleAmountRandom() 1460 { 1461 return getParamRandomness(8); 1462 } 1463 /// ditto 1464 @property void scaleAmountRandom(double v) 1465 { 1466 setParamRandomness(8, v); 1467 } 1468 /** 1469 Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. 1470 */ 1471 @property double speedScale() 1472 { 1473 return getSpeedScale(); 1474 } 1475 /// ditto 1476 @property void speedScale(double v) 1477 { 1478 setSpeedScale(v); 1479 } 1480 /** 1481 Each particle's initial direction range from `+spread` to `-spread` degrees. 1482 */ 1483 @property double spread() 1484 { 1485 return getSpread(); 1486 } 1487 /// ditto 1488 @property void spread(double v) 1489 { 1490 setSpread(v); 1491 } 1492 /** 1493 Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. 1494 */ 1495 @property double tangentialAccel() 1496 { 1497 return getParam(5); 1498 } 1499 /// ditto 1500 @property void tangentialAccel(double v) 1501 { 1502 setParam(5, v); 1503 } 1504 /** 1505 Each particle's tangential acceleration will vary along this $(D Curve). 1506 */ 1507 @property Curve tangentialAccelCurve() 1508 { 1509 return getParamCurve(5); 1510 } 1511 /// ditto 1512 @property void tangentialAccelCurve(Curve v) 1513 { 1514 setParamCurve(5, v); 1515 } 1516 /** 1517 Tangential acceleration randomness ratio. 1518 */ 1519 @property double tangentialAccelRandom() 1520 { 1521 return getParamRandomness(5); 1522 } 1523 /// ditto 1524 @property void tangentialAccelRandom(double v) 1525 { 1526 setParamRandomness(5, v); 1527 } 1528 /** 1529 Particle texture. If `null`, particles will be squares. 1530 */ 1531 @property Texture texture() 1532 { 1533 return getTexture(); 1534 } 1535 /// ditto 1536 @property void texture(Texture v) 1537 { 1538 setTexture(v); 1539 } 1540 }