[Include] textanims.inc - Experimental textdraw animations editor
#1

Fader.inc
Last Updated: 16 July, 2018

A simple Global and Player textdraw color fader. You can fade any textdraw text color or box color or both.

Download
https://github.com/Agneese-Saini/SA-...lude/fader.inc

Wiki
PHP Code:
// 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(playeridText:textfrom_colorto_colorupdate_rate 2timer_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(playeridText:textfrom_colorto_colorupdate_rate 2timer_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(playeridText: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(playeridText: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(playeridText:texttype);
#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(playeridPlayerText:textfrom_colorto_colorupdate_rate 2timer_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(playeridPlayerText:textfrom_colorto_colorupdate_rate 2timer_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(playeridPlayerText: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(playeridPlayerText: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(playeridPlayerText:texttype);
#endif
//////////////////////////////////// 
Reply
#2

Yet another release! You're one of the most contributing member in 2016-2017 according to me.
If someone can add a video displaying the include's capabilities that would be nice
Reply
#3

Another great release from the ginger!

Quote:
Originally Posted by Gammix
View Post
I don't know if this is that useful but i was getting bored at 4am, so i made this
I am just wondering if anyone would think of something like this when getting bored at 4am.
Reply
#4

Nice one homie.
Reply
#5

Great!
Reply
#6

awesome
Reply
#7

This is great, I would've used it on my server but since I'm not a fan of using textdraws, I won't unless I get up with ideas where textdraws would prove helpful.

Well done.
Reply
#8

Quote:
Originally Posted by Debjit
View Post
Another great release from the ginger!



I am just wondering if anyone would think of something like this when getting bored at 4am.
lmao, same.

OT: Great release.
Reply
#9

This has potential, good job!
Reply
#10

Could we please get some videos to show exactly how this works?
Reply
#11

Quote:
Originally Posted by Ritzy
View Post
Yet another release! You're one of the most contributing member in 2016-2017 according to me.
I couldn't agree more! It's like every other day I check the forums & see another unique release by him
Reply
#12

This sure is an amazing release, great job!!
I haven’t been around/script for quite a while, just cameback, so haven’t seen your other works yet. But I see people enjoy your releases/works which has me looking forward to see more, so keep it up
Reply
#13

Can you record a video?
Reply
#14

Code:
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);
Reply
#15

frames?
Reply
#16

Yes frames.
Reply
#17

Quote:
Originally Posted by Pottus
View Post
Yes frames.
I don't understand what you mean by "frames"?
Reply
#18

https://caworld3.files.wordpress.com...untitled-1.jpg
Reply
#19

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".
Reply
#20

Quote:
Originally Posted by Y_Less
View Post
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".
1. I have plans for that. Still hooking all textdraw functions... Please wait Lol
2. Yes, i was gonna add multiple args first but for now i can remove it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)