SetReleaseQuantity
This function specifies the number of particles released at each interval.
Syntax
- void SetReleaseQuantity(int quantity)
Example
#include "Leadwerks.h"
using namespace Leadwerks;
int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
World* world = World::Create();
Camera* camera = Camera::Create();
camera->Move(0, 0, -3);
int releasequantity = 10;
//Create an emitter
Emitter* emitter = Emitter::Create(50);
emitter->SetReleaseQuantity(releasequantity);
while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;
Leadwerks::Leadwerks::Time::Update();
world->Update();
world->Render();
if (window->KeyDown(Key::Up) && releasequantity < 50)
{
++releasequantity;
emitter->SetReleaseQuantity(releasequantity);
}
else if (window->KeyDown(Key::Down) && releasequantity > 1)
{
--releasequantity;
emitter->SetReleaseQuantity(releasequantity);
}
context->SetBlendMode(Blend::Alpha);
context->DrawText("Release Quantity: " + String(emitter->GetReleaseQuantity()), 2, 2);
context->SetBlendMode(Blend::Solid);
context->Sync();
}
}