Table Of Contents

Previous topic

17.11. The RenderTarget Object

Next topic

17.13. The Shader Object

This Page

17.12. The Semantics Object

A Semantics object is an optimal container for vertex attributes semantic information and it is required for setting streams or for inline geometry drawing.

This object behaves as a JavaScript array, after its creation you can iterate over its elements and modify them directly as with any other array:

// create Semantics object
var semantics = graphicsDevice.createSemantics([graphicsDevice.SEMANTIC_POSITION,

// print the raw semantic values
var numSemantics = semantics.length;
for (var n = 0; n < numSemantics; n += 1)

// Append a new one
semantics[semantics.length] = graphicsDevice.SEMANTIC_TEXCOORD;

You can find a list of supported semantics here graphicsDevice.SEMANTIC_.

17.12.1. Properties length


Number of semantics stored on the Semantics object.


var numSemantics = semantics.length;