CreateSprite3D()

Syntax

Result = CreateSprite3D(#Sprite3D, #Sprite)
Description
Create a 3D sprite with the specified 2D sprite. If #PB_Any is used as '#Sprite3D' parameter, the new sprite3d number will be returned as 'Result'. A 3D sprite is only 4 points (a rectangle) where a texture will be mapped on it. You can't draw directly on a 3D sprite.

The texture is in fact a regular sprite loaded by LoadSprite() or CatchSprite() or created by CreateSprite() using the #PB_Sprite_Texture mode. The texture must be a square of one of the following dimensions: 16*16, 32*32, 64*64, 128*128 or 256*256. Other sizes may work on some specific cards, but not all.

If the 'Result' is 0, then the 3D Sprite can't be created, else it's ok.

The 2D sprite used to create the 3D sprite must not be deleted when a 3D sprite use it. A single 2D Sprite can be used by any number of 3D Sprite.

Supported OS

Windows, MacOS X

Sprite3D Index - DisplaySprite3D() ->