SA-MP Forums Archive
[Include] textanims.inc - Experimental textdraw animations editor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] textanims.inc - Experimental textdraw animations editor (/showthread.php?tid=644785)



fader.inc - Global and Player textdarw fader - Gammix - 14.11.2017

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
//////////////////////////////////// 



Re: textanims.inc - Experimental textdraw animations editor - Ritzy2K - 14.11.2017

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


Re: textanims.inc - Experimental textdraw animations editor - Zeth - 14.11.2017

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.


Re: textanims.inc - Experimental textdraw animations editor - HydraHumza - 14.11.2017

Nice one homie.


Re: textanims.inc - Experimental textdraw animations editor - DonaldDuck - 14.11.2017

Great!


Re: textanims.inc - Experimental textdraw animations editor - Ponga - 14.11.2017

awesome


Re: textanims.inc - Experimental textdraw animations editor - Meller - 14.11.2017

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.


Re: textanims.inc - Experimental textdraw animations editor - cuber - 14.11.2017

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.


Re: textanims.inc - Experimental textdraw animations editor - Eoussama - 14.11.2017

This has potential, good job!


Re: textanims.inc - Experimental textdraw animations editor - TheAdrenalin - 14.11.2017

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


Re: textanims.inc - Experimental textdraw animations editor - Chaprnks - 14.11.2017

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


Re: textanims.inc - Experimental textdraw animations editor - Andre02 - 15.11.2017

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


Re: textanims.inc - Experimental textdraw animations editor - Romz - 15.11.2017

Can you record a video?


Re: textanims.inc - Experimental textdraw animations editor - Pottus - 15.11.2017

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);



Re: textanims.inc - Experimental textdraw animations editor - Gammix - 15.11.2017

frames?


Re: textanims.inc - Experimental textdraw animations editor - Pottus - 15.11.2017

Yes frames.


Re: textanims.inc - Experimental textdraw animations editor - Gammix - 15.11.2017

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


Re: textanims.inc - Experimental textdraw animations editor - Pottus - 15.11.2017

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


Re: textanims.inc - Experimental textdraw animations editor - Y_Less - 16.11.2017

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".


Re: textanims.inc - Experimental textdraw animations editor - Gammix - 16.11.2017

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.