SetScale

This function sets the scale of an entity, in local space.

Syntax

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();
light:SetRotation(35,35,0)

--Create a model
entity = Model:Box()
entity:SetColor(0.0,0.0,1.0)

        while (true)
        {
                if window:Closed() or window:KeyHit(Key.Escape) then return false end

entity:SetScale(Math:Sin(Time:GetCurrent()/100.0)*0.5+0.75)

Time:Update()
world:Update()
world:Render()

context:SetBlendMode(Blend.Alpha)
context:DrawText("Scale: "..entity:GetScale():ToString(),2,2)

context:Sync()
        }
        return 0;
}