Novelty scripting reference > Keywords > as

as

'as' is a keywords that is not normally part of the Angelscript language but has been added in Novelty. It is a casting operator. Angelscript already has a casting operator (cast<T>) and the as-keyword is just an alternative syntax.


Syntax

TypeA as TypeB

Angelscript equivalence

cast<TypeB>(TypeA)


Sample

// Change the contents of a text object
Text@ t = Scene.GetObject("Text object") as Text;
t.SetText("Hello Novelty");

Back to top