sprite=ImageToSprite(imagehandle[,flags][,parent])

Parameters

imagehandle - handle of existing 2d image

flags (optional):
1: Color *
2: Alpha
4: Masked *
8: Mipmapped
16: Clamp U
32: Clamp V
64: Spherical reflection map
128: <void>
256: Store texture in vram
512: Force the use of high color textures

* Default

parent (optional) - give an alternative entity in which to attach the sprite to
By default the parent is the pivot as created by:
SpriteGraphics3D or CreateSpritePivot()

Description

Creates a sprite from an existing 2D image.
The sprite will be set to the same size as the 2D image.

* NOTE: It is important to initialise the sprite display system first!
See SpriteGraphics3D or CreateSpritePivot()

Alternatively, you might want to attach the sprite to your own pivot/entity.
If so, just pass it's handle to the optional parent parameter.

See Also: FreeImage3D

Example

Include "Sprite Control.bb"

SpriteGraphics3D 640,480

image=LoadImage("test.bmp")
mysprite=ImageToSprite(image)

RenderWorld
Flip
WaitKey
End


Index