Advertisement
Guest User

Test script for TextDrawAnimations

a guest
Mar 23rd, 2012
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.57 KB | None | 0 0
  1. #include <a_samp>
  2. #include <TextDrawAnimations>
  3.  
  4. #define TEXTDRAWS_ANIMATION_FINISH 0
  5. #define TEXTDRAWS_ANIMATION_0   1
  6. #define TEXTDRAWS_ANIMATION_1   2
  7.  
  8. main()
  9. {
  10.     print("\n----------------------------------");
  11.     print(" Textdraw animations test");
  12.     print("----------------------------------\n");
  13. }
  14.  
  15. public OnGameModeInit()
  16. {  
  17.     SetGameModeText("Textdraw animations example!");
  18.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  19.     return 1;
  20. }
  21.  
  22. public OnGameModeExit()
  23. {
  24.     return 1;
  25. }
  26.  
  27. public OnPlayerRequestClass(playerid, classid)
  28. {
  29.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  30.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  31.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  32.     return 1;
  33. }
  34.  
  35. public OnPlayerCommandText(playerid, cmdtext[])
  36. {
  37.     if (strcmp("/anm", cmdtext, true, 10) == 0)
  38.     {      
  39.         CreateDynamicTextdraws( TEXTDRAWS_ANIMATION_0 );
  40.         TextDraw_FadeIn( playerid, TEXTDRAWS_ANIMATION_0, 100, 2000, 0, 4 );       
  41.         return 1;
  42.     }
  43.  
  44.     return 0;
  45. }
  46.  
  47. public OnAnimFinish( playerid, index )
  48. {
  49.     switch( index )
  50.     {
  51.         case TEXTDRAWS_ANIMATION_0:
  52.         {
  53.             TextDraw_Grow(playerid,TEXTDRAWS_ANIMATION_1,100,2500, 0, 4, 1.3, 4.0);
  54.         }
  55.         case TEXTDRAWS_ANIMATION_1:
  56.         {
  57.             TextDraw_Pulsate(playerid,TEXTDRAWS_ANIMATION_FINISH,10,100,0,4 );
  58.         }
  59.         case TEXTDRAWS_ANIMATION_FINISH:
  60.         {
  61.             TextDraw_Hide( playerid, 0, -1 );
  62.         }
  63.     }
  64.    
  65.     return 1;
  66. }
  67.  
  68. CreateDynamicTextdraws( index )
  69. {
  70.     switch( index )
  71.     {
  72.         case TEXTDRAWS_ANIMATION_0:
  73.         {
  74.             T_Buffer[0] = TextDrawCreate(320.000000, 130.000000, "You");
  75.             TextDrawAlignment(T_Buffer[0], 2);
  76.             TextDrawBackgroundColor(T_Buffer[0], 255);
  77.             TextDrawFont(T_Buffer[0], 1);
  78.             TextDrawLetterSize(T_Buffer[0], 1.300000, 4.000000);
  79.             TextDrawColor(T_Buffer[0], -16776961);
  80.             TextDrawSetOutline(T_Buffer[0], 0);
  81.             TextDrawSetProportional(T_Buffer[0], 1);
  82.             TextDrawSetShadow(T_Buffer[0], 1);
  83.  
  84.             T_Buffer[1] = TextDrawCreate(320.000000, 160.000000, "Can");
  85.             TextDrawAlignment(T_Buffer[1], 2);
  86.             TextDrawBackgroundColor(T_Buffer[1], 255);
  87.             TextDrawFont(T_Buffer[1], 1);
  88.             TextDrawLetterSize(T_Buffer[1], 1.300000, 4.000000);
  89.             TextDrawColor(T_Buffer[1], -16776961);
  90.             TextDrawSetOutline(T_Buffer[1], 0);
  91.             TextDrawSetProportional(T_Buffer[1], 1);
  92.             TextDrawSetShadow(T_Buffer[1], 1);
  93.  
  94.             T_Buffer[2] = TextDrawCreate(320.000000, 190.000000, "Animate");
  95.             TextDrawAlignment(T_Buffer[2], 2);
  96.             TextDrawBackgroundColor(T_Buffer[2], 255);
  97.             TextDrawFont(T_Buffer[2], 1);
  98.             TextDrawLetterSize(T_Buffer[2], 1.300000, 4.000000);
  99.             TextDrawColor(T_Buffer[2], -16776961);
  100.             TextDrawSetOutline(T_Buffer[2], 0);
  101.             TextDrawSetProportional(T_Buffer[2], 1);
  102.             TextDrawSetShadow(T_Buffer[2], 1);
  103.  
  104.             T_Buffer[3] = TextDrawCreate(320.000000, 220.000000, "this text!");
  105.             TextDrawAlignment(T_Buffer[3], 2);
  106.             TextDrawBackgroundColor(T_Buffer[3], 255);
  107.             TextDrawFont(T_Buffer[3], 1);
  108.             TextDrawLetterSize(T_Buffer[3], 1.300000, 4.000000);
  109.             TextDrawColor(T_Buffer[3], -16776961);
  110.             TextDrawSetOutline(T_Buffer[3], 0);
  111.             TextDrawSetProportional(T_Buffer[3], 1);
  112.             TextDrawSetShadow(T_Buffer[3], 1);
  113.            
  114.             T_Buffer[4] = TextDrawCreate(340.000000, 280.000000, "Or make it grow!!!");
  115.             TextDrawAlignment(T_Buffer[4], 2);
  116.             TextDrawBackgroundColor(T_Buffer[4], 255);
  117.             TextDrawFont(T_Buffer[4], 1);
  118.             TextDrawLetterSize(T_Buffer[4], 1.300000, 4.000000);
  119.             TextDrawColor(T_Buffer[4], -16711681);
  120.             TextDrawSetOutline(T_Buffer[4], 0);
  121.             TextDrawSetProportional(T_Buffer[4], 1);
  122.             TextDrawSetShadow(T_Buffer[4], 1);
  123.         }
  124.     }
  125.    
  126.     return 1;
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement