3D Lingo Dictionary > L-N > newTexture

 

newTexture

Syntax

member(whichCastmember).newTexture(newTextureName {,#typeIndicator, sourceObjectReference})

Description

3D command; creates a new texture within the referenced member's texture palette and returns a reference to the new texture. All textures in the member's texture palette must have a unique name. The #typeIndicator and sourceObjectReference parameters are optional, and if not specified a new texture with no type or source is created. The only way cast member textures will work is if you specify the cast member in the newTexture constructor.

The #typeIndicator parameter can have two values, #fromCastMember (a cast member) or #fromImageObject (a lingo image object). The sourceObjectReference parameter must be a cast member reference if you specify #fromCastMember, or must be a Lingo image object if you specify #fromImageObject.

Example

The first line of this statement creates a new texture called Grass 02 from castmember 5 of castlib 1. The second line creates a blank new texture called Blank.

member("3D World").newTexture("Grass 02",#fromCastMember,member(5,1))
member("3D World").newTexture("Blank")