Characters

Characters

Description

SwinGame Characters are Sprites with additional functionality to handle animations for movement and state. For example, you may have a Soldier character with images and animations for moving in 8 directions (N, NE, E, etc..). The Soldier may also have states for walking, running, crawling, etc. With this data encapsulated within a character you can then set the state of the character to walking, and the character code will take care of choosing the correct images for this state and movement based on the Character's sprite's movement.

Characters in SwinGame may also have layers which can be selectively shown. These layers can then be used to add items or represent levels for your character.

Character Angle At

Returns the DirectionAngles data at the selected index. The min and max of this record can be accessed by .min and .max

  • Character Angle At (c, index) : DirectionAngles [show]

    Returns the DirectionAngles data at the selected index. The min and max of this record can be accessed by .min and .max

    Parameters:
    c : Character
    index : Longint
    Returns:
    DirectionAngles :
    Signatures by Language:
    C/C++: direction_angles character_angle_at(character c, int32_t index);
    Pascal: function CharacterAngleAt(c: Character; index: Longint): DirectionAngles;

Character Angle Max At

Returns the maximum angle in the DirectionAngles record at the index specified

  • Character Angle Max At (c, index) : Longint [show]

    Returns the maximum angle in the DirectionAngles record at the index specified

    Parameters:
    c : Character
    index : Longint
    Returns:
    Longint :
    Signatures by Language:
    C/C++: int32_t character_angle_max_at(character c, int32_t index);
    Pascal: function CharacterAngleMaxAt(c: Character; index: Longint): Longint;

Character Angle Min At

Returns the minimum angle in the DirectionAngles record at the index specified

  • Character Angle Min At (c, index) : Longint [show]

    Returns the minimum angle in the DirectionAngles record at the index specified

    Parameters:
    c : Character
    index : Longint
    Returns:
    Longint :
    Signatures by Language:
    C/C++: int32_t character_angle_min_at(character c, int32_t index);
    Pascal: function CharacterAngleMinAt(c: Character; index: Longint): Longint;

Character Angles Length

Returns the count of the Angles of the character

  • Character Angles Length (c) : Longint [show]

    Returns the count of the Angles of the character

    Parameters:
    c : Character
    Returns:
    Longint :
    Signatures by Language:
    C/C++: int32_t character_angles_length(character c);
    Pascal: function CharacterAnglesLength(c: Character): Longint;

Character Character Name

Returns the Character's name

  • Character Character Name (c) : String [show]

    Returns the Character's name

    Parameters:
    c : Character
    Returns:
    String :
    Signatures by Language:
    C/C++: void character_character_name(character c, char *result);
    Pascal: function CharacterCharacterName(c: Character): String;

Character Current Direction

Returns the index of the current direction of the character

  • Character Current Direction (c) : Longint [show]

    Returns the index of the current direction of the character

    Parameters:
    c : Character
    Returns:
    Longint :
    Signatures by Language:
    C/C++: int32_t character_current_direction(character c);
    Pascal: function CharacterCurrentDirection(c: Character): Longint;

Character Current State

Returns the index of the current state of the character

  • Character Current State (c) : Longint [show]

    Returns the index of the current state of the character

    Parameters:
    c : Character
    Returns:
    Longint :
    Signatures by Language:
    C/C++: int32_t character_current_state(character c);
    Pascal: function CharacterCurrentState(c: Character): Longint;

Character Direction Count

Returns the count of the amount of directions that the character has

  • Character Direction Count (c) : Longint [show]

    Returns the count of the amount of directions that the character has

    Parameters:
    c : Character
    Returns:
    Longint :
    Signatures by Language:
    C/C++: int32_t character_direction_count(character c);
    Pascal: function CharacterDirectionCount(c: Character): Longint;

Character Directions

Returns all of the possible directions of the character

  • Character Directions (c) : StringArray [show]

    Returns all of the possible directions of the character

    Parameters:
    c : Character
    Returns:
    StringArray :
    Signatures by Language:
    C/C++: void character_directions(character c, string_array result, int32_t result_len);
    Pascal: function CharacterDirections(c: Character): StringArray;

Character Filename

Returns the name of the file that was used to load the character's details.

  • Character Filename (c) : String [show]

    Returns the name of the file that was used to load the character's details.

    Parameters:
    c : Character
    Returns:
    String :
    Signatures by Language:
    C/C++: void character_filename(character c, char *result);
    Pascal: function CharacterFilename(c: Character): String;

Character Name

Returns the name of the character. This name can be used to retrieve this character using the CharacterNamed function.

  • Character Name (c) : String [show]

    Returns the name of the character. This name can be used to retrieve this character using the CharacterNamed function.

    Parameters:
    c : Character
    Returns:
    String :
    Signatures by Language:
    C/C++: void character_name(character c, char *result);
    Pascal: function CharacterName(c: Character): String;

Character Named

Returns the Character with the given name. You can specify the name to use in the resource bundle, or by calling the LoadCharacterNamed function.

  • Character Named (name) : Character [show]

    Returns the Character with the given name. You can specify the name to use in the resource bundle, or by calling the LoadCharacterNamed function.

    Parameters:
    name : String
    Returns:
    Character :
    Signatures by Language:
    C/C++: character character_named(const char *name);
    Pascal: function CharacterNamed(name: String): Character;

Character Set Current Direction

Sets the current direction of the character

  • Character Set Current Direction (c, direction) [show]

    Sets the current direction of the character

    Parameters:
    c : Character
    direction : Longint
    Signatures by Language:
    C/C++: void character_set_current_direction(character c, int32_t direction);
    Pascal: procedure CharacterSetCurrentDirection(c: Character; direction: Longint);

Character Set Current State

Sets the current state of the character

  • Character Set Current State (c, state) [show]

    Sets the current state of the character

    Parameters:
    c : Character
    state : Longint
    Signatures by Language:
    C/C++: void character_set_current_state(character c, int32_t state);
    Pascal: procedure CharacterSetCurrentState(c: Character; state: Longint);

Character Set Name

Sets the Character's name

  • Character Set Name (c, name) [show]

    Sets the Character's name

    Parameters:
    c : Character
    name : String
    Signatures by Language:
    C/C++: void character_set_name(character c, const char *name);
    Pascal: procedure CharacterSetName(c: Character; name: String);

Character Set Type

Sets the the name of the Type of Character(eg boss, grunt etc)

  • Character Set Type (c, name) [show]

    Sets the the name of the Type of Character(eg boss, grunt etc)

    Parameters:
    c : Character
    name : String
    Signatures by Language:
    C/C++: void character_set_type(character c, const char *name);
    Pascal: procedure CharacterSetType(c: Character; name: String);

Character Set Value

Set the value of the character.

  • Character Set Value (c, idx, val) [show]

    Set the value of the character.

    Parameters:
    c : Character
    idx : Longint
    val : Single
    Signatures by Language:
    C/C++: void character_set_value(character c, int32_t idx, float val);
    Pascal: procedure CharacterSetValue(c: Character; idx: Longint; val: Single);
  • Character Set Value (c, name, val) [show]

    Set the value of the character.

    Parameters:
    c : Character
    name : String
    val : Single
    Signatures by Language:
    C/C++: void character_set_value_by_name(character c, const char *name, float val);
    C++: void character_set_value(character c, const char *name, float val);
    Pascal: procedure CharacterSetValue(c: Character; name: String; val: Single);

Character Shown Layers At

Returns whether or not the layer at the selected index is drawn

  • Character Shown Layers At (c, index) : Boolean [show]

    Returns whether or not the layer at the selected index is drawn

    Parameters:
    c : Character
    index : Longint
    Returns:
    Boolean :
    Signatures by Language:
    C/C++: bool character_shown_layers_at(character c, int32_t index);
    Pascal: function CharacterShownLayersAt(c: Character; index: Longint): Boolean;

Character Sprite

Returns the character's sprite

  • Character Sprite (c) : Sprite [show]

    Returns the character's sprite

    Parameters:
    c : Character
    Returns:
    Sprite :
    Signatures by Language:
    C/C++: sprite character_sprite(character c);
    Pascal: function CharacterSprite(c: Character): Sprite;

Character State Count

Returns all of the possible states of the character

  • Character State Count (c) : Longint [show]

    Returns all of the possible states of the character

    Parameters:
    c : Character
    Returns:
    Longint :
    Signatures by Language:
    C/C++: int32_t character_state_count(character c);
    Pascal: function CharacterStateCount(c: Character): Longint;

Character States

Returns all of the possible directions of the character

  • Character States (c) : StringArray [show]

    Returns all of the possible directions of the character

    Parameters:
    c : Character
    Returns:
    StringArray :
    Signatures by Language:
    C/C++: void character_states(character c, string_array result, int32_t result_len);
    Pascal: function CharacterStates(c: Character): StringArray;

Character Type

Returns the string value of the character's type

  • Character Type (c) : String [show]

    Returns the string value of the character's type

    Parameters:
    c : Character
    Returns:
    String :
    Signatures by Language:
    C/C++: void character_type(character c, char *result);
    Pascal: function CharacterType(c: Character): String;

Character Value At

Returns the character's value at the index specified

  • Character Value At (c, index) : Single [show]

    Returns the character's value at the index specified

    Parameters:
    c : Character
    index : Longint
    Returns:
    Single :
    Signatures by Language:
    C/C++: float character_value_at(character c, int32_t index);
    Pascal: function CharacterValueAt(c: Character; index: Longint): Single;

Character Value Count

Returns the count of character values

  • Character Value Count (c) : Longint [show]

    Returns the count of character values

    Parameters:
    c : Character
    Returns:
    Longint :
    Signatures by Language:
    C/C++: int32_t character_value_count(character c);
    Pascal: function CharacterValueCount(c: Character): Longint;

Character Value Names

Returns the names of all of the values of the character

  • Character Value Names (c) : StringArray [show]

    Returns the names of all of the values of the character

    Parameters:
    c : Character
    Returns:
    StringArray :
    Signatures by Language:
    C/C++: void character_value_names(character c, string_array result, int32_t result_len);
    Pascal: function CharacterValueNames(c: Character): StringArray;

Draw Character

Draw Character without a stationary state with default facing down when not moving

  • Draw Character (c) [show]

    Draw Character without a stationary state with default facing down when not moving

    Parameters:
    c : Character
    Signatures by Language:
    C/C++: void draw_character(character c);
    Pascal: procedure DrawCharacter(c: Character);

Draw Character Sprite

Draws the character's sprite with no additional functionality

  • Draw Character Sprite (c) [show]

    Draws the character's sprite with no additional functionality

    Parameters:
    c : Character
    Signatures by Language:
    C/C++: void draw_character_sprite(character c);
    Pascal: procedure DrawCharacterSprite(c: Character);

Draw Character With Stationary

Draw Character that changes state when it's velocity is 0 to be the stationary state which is specified.

  • Draw Character With Stationary (c, stationaryState, state) [show]

    Draw Character that changes state when it's velocity is 0 to be the stationary state which is specified.

    Parameters:
    c : Character
    stationaryState : Longint
    state : Longint
    Signatures by Language:
    C/C++: void draw_character_with_stationary(character c, int32_t stationaryState, int32_t state);
    Pascal: procedure DrawCharacterWithStationary(c: Character; stationaryState: Longint; state: Longint);

Free Character

Free the resources associated with a Character. Please note that this also frees the Sprite that exists within the Character.

  • Free Character (var c) [show]

    Free the resources associated with a Character. Please note that this also frees the Sprite that exists within the Character.

    Parameters:
    c : Character
    Signatures by Language:
    C/C++: void free_character(character *c);
    C++: void free_character(character &c);
    Pascal: procedure FreeCharacter(var c: Character);

Has Character

Returns true if SwinGame has loaded a character with the indicated name.

  • Has Character (name) : Boolean [show]

    Returns true if SwinGame has loaded a character with the indicated name.

    Parameters:
    name : String
    Returns:
    Boolean :
    Signatures by Language:
    C/C++: bool has_character(const char *name);
    Pascal: function HasCharacter(name: String): Boolean;

Load Character

Loads the character from a text file

  • Load Character (filename) : Character [show]

    Loads the character from a text file

    Parameters:
    filename : String
    Returns:
    Character :
    Signatures by Language:
    C/C++: character load_character(const char *filename);
    Pascal: function LoadCharacter(filename: String): Character;

Load Character Named

Loads the character from a text file, and assigns the character the indicated name. This name can then be used to refer to this character in the CharacterNamed function.

  • Load Character Named (name, filename) : Character [show]

    Loads the character from a text file, and assigns the character the indicated name. This name can then be used to refer to this character in the CharacterNamed function.

    Parameters:
    name : String
    filename : String
    Returns:
    Character :
    Signatures by Language:
    C/C++: character load_character_named(const char *name, const char *filename);
    Pascal: function LoadCharacterNamed(name: String; filename: String): Character;

Release All Characters

Release all of the characters currently loaded into SwinGame.

  • Release All Characters () [show]

    Release all of the characters currently loaded into SwinGame.


Release Character

Free the resources associated with a Character with the given name.

  • Release Character (name) [show]

    Free the resources associated with a Character with the given name.

    Parameters:
    name : String
    Signatures by Language:
    C/C++: void release_character(const char *name);
    Pascal: procedure ReleaseCharacter(name: String);

Set Active Layer

Sets the active layers from the shown layers cache, using the current states and directions for the indexes of the array

  • Set Active Layer (c) [show]

    Sets the active layers from the shown layers cache, using the current states and directions for the indexes of the array

    Parameters:
    c : Character
    Signatures by Language:
    C/C++: void set_active_layer(character c);
    Pascal: procedure SetActiveLayer(c: Character);

Toggle Layer Visibility

Toggles whether or not the layer at the specified index is drawn or not

  • Toggle Layer Visibility (c, index) [show]

    Toggles whether or not the layer at the specified index is drawn or not

    Parameters:
    c : Character
    index : Longint
    Signatures by Language:
    C/C++: void toggle_layer_visibility(character c, int32_t index);
    Pascal: procedure ToggleLayerVisibility(c: Character; index: Longint);

Update Direction Animation

Update the animation of the character depending on it's direction. Returns true if the direction was changed and false if it was no changed

  • Update Direction Animation (c) : Boolean [show]

    Update the animation of the character depending on it's direction. Returns true if the direction was changed and false if it was no changed

    Parameters:
    c : Character
    Returns:
    Boolean :
    Signatures by Language:
    C/C++: bool update_direction_animation(character c);
    Pascal: function UpdateDirectionAnimation(c: Character): Boolean;

Update Direction Animation With Stationary

Update the animation of the character depending on it's direction, including updating When the character's state goes stationary

  • Update Direction Animation With Stationary (c, state, newState) : Boolean [show]

    Update the animation of the character depending on it's direction, including updating When the character's state goes stationary

    Parameters:
    c : Character
    state : Longint
    newState : Longint
    Returns:
    Boolean :
    Signatures by Language:
    C/C++: bool update_direction_animation_with_stationary(character c, int32_t state, int32_t newState);
    Pascal: function UpdateDirectionAnimationWithStationary(c: Character; state: Longint; newState: Longint): Boolean;