Unit 'agraphics' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#morphunits]

GetSprite

Attempt to get a sprite for the simple sprite manager.

Declaration

Source position: agraphics.pas line 2048

function GetSprite(

  Sprite: PSimpleSprite;

  Num: LongInt

):LongInt;

Arguments

Sprite

  

A Pointer to programmers SimpleSprite structure.

Function result

If pick is 0-7 attempt to allocate the sprite. If the sprite is already allocated then return -1. If pick -1 allocate the next sprite starting search at 0. If no sprites are available return -1 and fill -1 in num entry of SimpleSprite structure. If the sprite is available for allocation, mark it allocated and fill in the 'num' entry of the SimpleSprite structure. If successful return the sprite number.

Description

Attempt to allocate one of the eight sprites for private use with the simple sprite manager. This must be done before using further calls to the simple sprite machine. If the programmer wants to use 15 color sprites, they must allocate both sprites and set the SPRITE_ATTACHED bit in the odd sprite's posctldata array.

Errors

On some machines this will never return anything else than -1!

See also

FreeSprite

  

Return sprite for use by others and virtual sprite machine.

ChangeSprite

  

Change the sprite image pointer.

MoveSprite

  

Move sprite to a point relative to top of viewport.


Documentation generated on: 2021-07-30