SLUDGE

setCharacterExtra


Syntax:

setCharacterExtra (thisCharacter, setting);

Purpose:

Changes the properties for thisCharacter which determine how it is to be drawn. The setting parameter should be one of the following enumerations, or the sum of two or more of the following should you wish to enable more than one of the effects.

NORMAL Use this option on its own if you wish to enable none of the following features.

FIXEDSIZE The character is drawn at a fixed size, regardless of the current scale settings (see the setScale command).

FRONT The character is drawn in front of all non-FRONT characters.

NOZBUFFER The character is drawn in its entirety, regardless of any z-buffer (set using the setZBuffer function).

FIXTOSCREEN The character's x and y positions are used to determine where it is drawn on the screen/window (rather than in relation to the background image). In short... wherever the scene may scroll (using the aimCamera function) the character's image will remain in the same place in relation to the SLUDGE window.

NOLIGHTMAP The character isn't affected by the loaded light-map (set using the setLightMap function).

NOREMOVE The character isn't removed by the removeAllCharacters function (it can still be removed by the removeCharacter function).

RECTANGULAR When working out if the mouse is over this character, use the whole rectangular region not just the visible (non-transparent) pixels.

ICON A shorter (and marginally quicker) way to specify all of the following features: FIXEDSIZE + FRONT + NOZBUFFER + FIXTOSCREEN + NOLIGHTMAP

If thisCharacter is an object type which is not currently represented on the screen as a character, the code has no effect. If thisCharacter has been hidden using the hideCharacter command, the character's properties are changed but the character is not made visible.

Return value:

TRUE if thisCharacter is an object type which is currently represented on the screen as a character, otherwise FALSE (i.e. TRUE if the call to the function was a success).

Example:

addCharacter (inventoryIcon, 600, 40, spinningInventoryBoxAnimation);
setCharacterExtra (inventoryIcon, ICON + NOREMOVE);

addCharacter (lensFlare, 600, 40, lensFlareAnimation);
setCharacterExtra (inventoryIcon, FIXEDSIZE + NOZBUFFER + NOLIGHTMAP);

See also:

Object Types as Characters

addCharacter

setCharacterDrawMode

showCharacter