Text line rendering and editing

Text funtions for drawing and editing a single line of text.

seduce_text_line_draw

float seduce_text_line_draw(SeduceRenderFont *font, float pos_x, float pos_y, float letter_size, float letter_spacing, const char *text, float red, float green, float blue, float alpha, uint length);

Description: Draws a like of text.

seduce_text_line_hit_test

uint seduce_text_line_hit_test(SeduceRenderFont *font, float letter_size, float letter_spacing, const char *text, float pos_x);

Description: Returns the charactre position that is pos_x to the left, in the string "text" if renderd using font and letter_size and letter_spacing.

seduce_text_line_length

float seduce_text_line_length(SeduceRenderFont *font, float size, float spacing, const char *text, uint end);

Description: Computes the length of a string renderd using font and letter_size and letter_spacing. If the string is longer then "end" number of characters only the characters before end will be messuers.

seduce_text_edit_line

STypeInState seduce_text_edit_line(BInputState *input, void *id, SeduceRenderFont *font, char *text, uint buffer_size, float pos_x, float pos_y, float length, float size, char *label, boolean left, void (*done_func)(void *user, char *text), void *user, float red, float green, float blue, float alpha, float active_red, float active_green, float active_blue, float active_alpha);

Description: Creates an editable text field. Lable will be printed if the text field is empty. The text striing cna either be modifyed as the user types, or if given a done_func a call back can be called when the user completes the typing with a new string.

Types:

Enum:

STypeInState

S_TIS_IDLE

Description: The type in function is idle.

S_TIS_ACTIVE

Description: The type in function is activly beeing used.

S_TIS_DONE

Description: The use th ethe type in function has just ben completed (mosst often by the user pressing Enter).

seduce_text_edit_obfuscated

STypeInState seduce_text_edit_obfuscated(BInputState *input, void *id, char *text, uint buffer_size, float pos_x, float pos_y, float length, float size, char *label, boolean left, void (*done_func)(void *user, char *text), void *user, float red, float green, float blue, float alpha, float active_red, float active_green, float active_blue, float active_alpha);

Description: Creates an editable text field where all charcters are obfuscated. Lable will be printed if the text field is empty. The text striing cna either be modifyed as the user types, or if given a done_func a call back can be called when the user completes the typing with a new string.

Types:

Enum:

STypeInState

S_TIS_IDLE

Description: The type in function is idle.

S_TIS_ACTIVE

Description: The type in function is activly beeing used.

S_TIS_DONE

Description: The use th ethe type in function has just ben completed (mosst often by the user pressing Enter).

seduce_text_edit_double

STypeInState seduce_text_edit_double(BInputState *input, void *id, SeduceRenderFont *font, double *value, float pos_x, float pos_y, float length, float size, boolean left, void (*done_func)(void *user, double value), void *user, float red, float green, float blue, float alpha, float active_red, float active_green, float active_blue, float active_alpha);

Description: Creates an editable text feild for typing in 64bit floating point numbers. Lable will be printed if the text field is empty. The text striing cna either be modifyed as the user types, or if given a done_func a call back can be called when the user completes the typing with a new string.

Types:

Enum:

STypeInState

S_TIS_IDLE

Description: The type in function is idle.

S_TIS_ACTIVE

Description: The type in function is activly beeing used.

S_TIS_DONE

Description: The use th ethe type in function has just ben completed (mosst often by the user pressing Enter).

seduce_text_edit_float

STypeInState seduce_text_edit_float(BInputState *input, void *id, SeduceRenderFont *font, float *value, float pos_x, float pos_y, float length, float size, boolean left, void (*done_func)(void *user, float value), void *user, float red, float green, float blue, float alpha, float active_red, float active_green, float active_blue, float active_alpha);

Description: Creates an editable text feild for typing in 32bit floating point numbers. Lable will be printed if the text field is empty. The text striing cna either be modifyed as the user types, or if given a done_func a call back can be called when the user completes the typing with a new string.

Types:

Enum:

STypeInState

S_TIS_IDLE

Description: The type in function is idle.

S_TIS_ACTIVE

Description: The type in function is activly beeing used.

S_TIS_DONE

Description: The use th ethe type in function has just ben completed (mosst often by the user pressing Enter).

seduce_text_edit_int

STypeInState seduce_text_edit_int(BInputState *input, void *id, SeduceRenderFont *font, int *value, float pos_x, float pos_y, float length, float size, boolean left, void (*done_func)(void *user, int value), void *user, float red, float green, float blue, float alpha, float active_red, float active_green, float active_blue, float active_alpha);

Description: Creates an editable text feild for typing in 32bit signed integer numbers. The text striing cna either be modifyed as the user types, or if given a done_func a call back can be called when the user completes the typing with a new string.

Types:

Enum:

STypeInState

S_TIS_IDLE

Description: The type in function is idle.

S_TIS_ACTIVE

Description: The type in function is activly beeing used.

S_TIS_DONE

Description: The use th ethe type in function has just ben completed (mosst often by the user pressing Enter).

seduce_text_edit_uint

STypeInState seduce_text_edit_uint(BInputState *input, void *id, SeduceRenderFont *font, uint *value, float pos_x, float pos_y, float length, float size, boolean left, void (*done_func)(void *user, uint value), void *user, float red, float green, float blue, float alpha, float active_red, float active_green, float active_blue, float active_alpha);

Description: Creates an editable text feild for typing in 64bit unsigend integer numbers. Lable will be printed if the text field is empty. The text striing cna either be modifyed as the user types, or if given a done_func a call back can be called when the user completes the typing with a new string.

Types:

Enum:

STypeInState

S_TIS_IDLE

Description: The type in function is idle.

S_TIS_ACTIVE

Description: The type in function is activly beeing used.

S_TIS_DONE

Description: The use th ethe type in function has just ben completed (mosst often by the user pressing Enter).

seduce_text_edit_active

boolean seduce_text_edit_active(void *id);

Description: Returns True if the id is curtrently active in one of the text editing functions