C3DSprite::Load |
Top Previous Next |
Syntax:
Load(C3DScreen pScreen, string filename, opt int width = 0 , opt int height = 0 , opt int frames = 0 , opt UINT colorKey = 0xFFFFFFFF ), int
Purpose: Loads a sprite from an image file.
Parameters: pScreen - A C3DScreen object. filename - Fully qualified pathname to the texture used by the sprite. width - The width of one frame of animation contained in the texture. height - The height of one frame of animation contained in the texture. frames - The number of animation frames contained in the texture. colorKey - A transparency color key for the sprite. To use the alpha channel of the texture leave this parameter at its default.
Returned value(s): 1 on success, -1 on failure.
Application: 'the file contains two sprites with 8 frames of animation each.
Class Hierarchy
Additional Info: If the entire texture is to be used for the sprite then width, height and frames can be set to 0. |