CountAlphaControlPoints

This function returns the number of scale control points set.

Syntax

Returns

The number of scale control points.

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->SetRotation(35, 0, 0);
camera->Move(0, 0, -3);
Light* light = DirectionalLight::Create();
light->SetRotation(35, 35, 0);

//Create an emitter
Emitter* emitter = Emitter::Create(100);

emitter->ClearAlphaControlPoints();//Remove default control points

emitter->AddScaleControlPoint(0, 0); //at spawn the particle will have a scale of 0
emitter->AddScaleControlPoint(.5, 1); //halfway through the particle's lifetime its be equal to max scale
emitter->AddScaleControlPoint(1, 0); //at death the particle will have a scale of 0

while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;

Leadwerks::Leadwerks::Time::Update();
world->Update();
world->Render();

context->SetBlendMode(Blend::Alpha);
context->DrawText("number of scale control points: " + String(emitter->CountScaleControlPoints()), 2, 2);
context->SetBlendMode(Blend::Solid);

context->Sync();
}
}