// To set how many textdraw can be faded at once, define this before inclusion!
#define MAX_TEXT_DRAW_FADES (16)
////////////////////////////////////
// GLOBAL TEXTDRAW FADER FUNCTIONS
////////////////////////////////////
/****************************************************
* Function: TextDrawFadeForPlayer()
* Purpose: Start fadinga global textdraw text color for player!
* Parameters: "playerid" - player's id
* "text" - textdraw id
* "from_color" - starting fade color
* "to_color" - ending fade color
* "update_rate" - rate at which the color fades during each timer's interval
* "timer_interval" - speed of timer
* Return: 1 - success
* 0 - failure
****************************************************/
forward TextDrawFadeForPlayer(playerid, Text:text, from_color, to_color, update_rate = 2, timer_interval = 50);
/****************************************************
* Function: TextDrawBoxFadeForPlayer()
* Purpose: Start fadinga global textdraw box color for player!
* Parameters: "playerid" - player's id
* "text" - textdraw id
* "from_color" - starting fade color
* "to_color" - ending fade color
* "update_rate" - rate at which the color fades during each timer's interval
* "timer_interval" - speed of timer
* Return: 1 - success
* 0 - failure
****************************************************/
forward TextDrawBoxFadeForPlayer(playerid, Text:text, from_color, to_color, update_rate = 2, timer_interval = 50);
/****************************************************
* Function: TextDrawStopFadeForPlayer()
* Purpose: Stop fading a global textdraw text color for player!
* Parameters: "playerid" - player's id
* "text" - textdraw id
* Return: 1 - success
* 0 - failure
****************************************************/
forward TextDrawStopFadeForPlayer(playerid, Text:text);
/****************************************************
* Function: TextDrawStopBoxFadeForPlayer()
* Purpose: Stop fading a global textdraw box color for player!
* Parameters: "playerid" - player's id
* "text" - textdraw id
* Return: 1 - success
* 0 - failure
****************************************************/
forward TextDrawStopBoxFadeForPlayer(playerid, Text:text);
#if defined OnTextDrawFaded
/****************************************************
* Method: OnTextDrawFaded()
* Purpose: Called when the textdraw is fully faded to the final color
* Parameters: "playerid" - player's id
* "text" - textdraw id
* "type" - 0 (TEXTDRAW_FADE_TEXT), 1(TEXTDRAW_FADE_BOX)
* Return: -
****************************************************/
forward OnTextDrawFaded(playerid, Text:text, type);
#endif
////////////////////////////////////
// PLAYER TEXTDRAW FADER FUNCTIONS
////////////////////////////////////
/****************************************************
* Function: PlayerTextDrawFade()
* Purpose: Start fadinga player textdraw text color for player!
* Parameters: "playerid" - player's id
* "text" - player textdraw id
* "from_color" - starting fade color
* "to_color" - ending fade color
* "update_rate" - rate at which the color fades during each timer's interval
* "timer_interval" - speed of timer
* Return: 1 - success
* 0 - failure
****************************************************/
forward PlayerTextDrawFade(playerid, PlayerText:text, from_color, to_color, update_rate = 2, timer_interval = 50);
/****************************************************
* Function: PlayerTextDrawBoxFade()
* Purpose: Start fadinga player textdraw box color for player!
* Parameters: "playerid" - player's id
* "text" - player textdraw id
* "from_color" - starting fade color
* "to_color" - ending fade color
* "update_rate" - rate at which the color fades during each timer's interval
* "timer_interval" - speed of timer
* Return: 1 - success
* 0 - failure
****************************************************/
forward PlayerTextDrawBoxFade(playerid, PlayerText:text, from_color, to_color, update_rate = 2, timer_interval = 50);
/****************************************************
* Function: PlayerTextDrawStopFade()
* Purpose: Stop fading a player textdraw text color!
* Parameters: "playerid" - player's id
* "text" - textdraw id
* Return: 1 - success
* 0 - failure
****************************************************/
forward PlayerTextDrawStopFade(playerid, PlayerText:text);
/****************************************************
* Function: PlayerTextDrawStopBoxFade()
* Purpose: Stop fading a player textdraw box color!
* Parameters: "playerid" - player's id
* "text" - textdraw id
* Return: 1 - success
* 0 - failure
****************************************************/
forward PlayerTextDrawStopBoxFade(playerid, PlayerText:text);
#if defined OnPlayerTextDrawFaded
/****************************************************
* Method: OnPlayerTextDrawFaded()
* Purpose: Called when the player textdraw is fully faded to the final color
* Parameters: "playerid" - player's id
* "text" - player textdraw id
* "type" - 0 (TEXTDRAW_FADE_TEXT), 1(TEXTDRAW_FADE_BOX)
* Return: -
****************************************************/
forward OnPlayerTextDrawFaded(playerid, PlayerText:text, type);
#endif
////////////////////////////////////
I don't know if this is that useful but i was getting bored at 4am, so i made this
|
Another great release from the ginger!
I am just wondering if anyone would think of something like this when getting bored at 4am. |
Yet another release! You're one of the most contributing member in 2016-2017 according to me.
|
TextAnim_SetData(index, frame, E_ANIMATION:type, {Float, Text, _}:...); TextAnim_GetData(index, frame, E_ANIMATION:type, {Float, Text, _}:...); TextAnim_Play(index, startframe, endframe, update_rate, timer_interval, continuous=false); TextAnim_Stop(index);
2 questions:
1) What about positional movement? That's the main thing I'd be interested in as I already do that with some code and it would be nice to outsource that. In fact currently the only thing I do is the only thing you don't do. 2) Do you know you can put multiple tags on single variables as well as varargs? There's no need to use "..." in "TextAnim_SetData". |