[Include]TextDrawnMove 1.0


* Comentário

Essa Include foi desenvolvida para mover TextDraws dinamicamente, ela pode chegar a pesar 400kb a mais no GM, Não tem como melhorar isso pois é as Vars que armazenam os dados para que possa mover as TextDraws. Sei que com EMIT ficaria muito mais dinâmico mais como não sei mexer com EMIT não tem como eu fazer, Estou pensando em estudar isso para que possa trazer coisas Inovadores para o Forum! Espero que gostem!

*Como usar ?


Textdraw0 = TextDrawCreate(400.000000, 13.000000, "_"); 
TextDrawBackgroundColor(Textdraw0, 255); 
TextDrawFont(Textdraw0, 1); 
TextDrawLetterSize(Textdraw0, 0.500000, 6.199999); 
TextDrawColor(Textdraw0, -1); 
TextDrawSetOutline(Textdraw0, 0); 
TextDrawSetProportional(Textdraw0, 1); 
TextDrawSetShadow(Textdraw0, 1); 
TextDrawUseBox(Textdraw0, 1); 
TextDrawBoxColor(Textdraw0, 255); 
TextDrawTextSize(Textdraw0, 254.000000, 0.000000); 

Textdraw1 = TextDrawCreate(530.000000, 13.000000, "Teste"); 
TextDrawBackgroundColor(Textdraw1, 255); TextDrawFont(Textdraw1, 1); 
TextDrawLetterSize(Textdraw1, 0.400000, 1.899999); TextDrawColor(Textdraw1, -1); 
TextDrawSetOutline(Textdraw1, 0); TextDrawSetProportional(Textdraw1, 1); 
TextDrawSetShadow(Textdraw1, 1); 
TextDrawBoxColor(Textdraw1, 255); 

CMD:mover(playerid) {  
TextDrawMove(Textdraw0, 250.0, 383.0, 104.0, 0.0, 3, PT_MOVE_BOX, playerid);  
TextDrawMove(Textdraw1, 44.0, 311.0, 0.0, 0.0, 3, PT_MOVE_TEXT);  
return 1; 
}



TextDrawMove(Text:Td, Float:fX, Float:fY, Float:fX2, Float:fY2, Speed, Move, playerid = INVALID_PLAYER_ID);

*Text:Td - ID da TextDraw
*Float:fX, Float:fY - Coords da posição final da TextDraw(TextDrawCreate).
*Float:fX2, Float:fY2 - Coords da posição final da TextDraw(TextDrawTextSize).
*Speed - Velocidade do movimento, Valor inicial '1', valores consideráveis, '2' e '3', acima disso ficará muito rápido conforme a maior distância a mover!
*Move - Isso é conforme o TextDrawUseBox, se a TextDraw usar box coloque 'PT_MOVE_BOX' caso não usar box coloque 'PT_MOVE_TEXT'.
*playerid - Isso é, se a TextDraw será mostrada para todos ou somente para o determinado Player. 'INVALID_PLAYER_ID' será mostrada para todos.



pawn Code:
TextDrawGetXAndYPos(Text:text, Float:Var[2]); //Geta as Coords do TextDrawCreate. TextDrawGetXAndYTextSize(Text:text, Float:Var[2]); //Geta as Coords do TextDrawTextSize. TextDrawGetXAndYLetterSize(Text:text, Float:Var[2]); //Geta as Coords do TextDrawLetterSize.
Creditos:
Paulo_TerroR - Criador. Equipe SA-MP(Passado\Presente\Futuro) - SAMP. Drakins - Otimização ResetArray.

0 comentários:

Postar um comentário