SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 03/01/2018, 12:17 PM   #1
OneDay
Huge Clucker
 
Join Date: Sep 2015
Posts: 294
Reputation: 139
Default Coloured Text Draws

The last thread is gone. I made an include to use {RRGGBB} in TextDraw instead of ~r~:

https://github.com/On3d4y/TextDrawColour.inc

Examples:

PHP Code:
TextDrawCreate(2.000000100.000000"{000005}={00000A}={00000F}={000014}={000019}={00001E}={000023}={000028}={00002D}={000032}={000037}={00003C}={000041}={000046}={00004B}={000050}={000055}={00005A}={00005F}={000064}={000069}={00006E}={000073}={000078}={00007D}={000082}={000087}={00008C}={000091}={000096}={00009B}={0000A0}={0000A5}={0000AA}={0000AF}={0000B4}={0000B9}={0000BE}={0000C3}={0000C8}={0000CD}={0000D2}={0000D7}={0000DC}={0000E1}={0000E6}={0000EB}={0000F0}={0000F5}={0000FA}={0000FF}={FF0000}OneDay{0000FF}={0000FA}={0000F5}={0000F0}={0000EB}={0000E6}={0000E1}={0000DC}={0000D7}={0000D2}={0000CD}={0000C8}={0000C3}={0000BE}={0000B9}={0000B4}={0000AF}={0000AA}={0000A5}={0000A0}={00009B}={000096}={000091}={00008C}={000087}={000082}={00007D}={000078}={000073}={00006E}={000069}={000064}={00005F}={00005A}={000055}={000050}={00004B}={000046}={000041}={00003C}={000037}={000032}={00002D}={000028}={000023}={00001E}={000019}={000014}={00000F}={00000A}={000005}={000000}="); 
PHP Code:
CreatePlayerTextDraw(playerid10.000000310.000000"{000000}F{000040}u{000080}l{0000C0}l {00AAAA}C{AAAA00}o{A000A0}l{444000}o{000444}u{444444}r {033300}T{066600}e{099900}x{0CCC00}t {000000}D{400000}r{800000}a{C00000}w{FF0000}s"); 
All TextDraw and PlayerTextDraw functions are hooked:

PHP Code:
        new Text:TextDrawCreate(120.000000300.000000"{00FF00}Hello World");
        
TextDrawFont(t0);
        
TextDrawFont(t3);
        
TextDrawTextSize(t200.0500.0);
        
TextDrawColor(t0x000000FF);
        
TextDrawSetProportional(t1);
        
TextDrawSetShadow(t0);
        
TextDrawAlignment(t1);
        
TextDrawBoxColor(t0x00FF00AA);
        
TextDrawUseBox(t1);
        
TextDrawShowForPlayer(playeridt); 
And this adds a new alignment:

PHP Code:
TextDrawAlignment(t4); 
This is like 3, but wraps correct.

Also more new functions:

PHP Code:
stock Text:TextDrawCreate(Float:xFloat:ytext[]);
stock TextDrawDestroy(Text:text);
stock TextDrawLetterSize(Text:textFloat:xFloat:y);
stock TextDrawTextSize(Text:textFloat:xFloat:y);
stock TextDrawAlignment(Text:textalignment);
stock TextDrawColor(Text:textcolor);
stock TextDrawUseBox(Text:text, use);
stock TextDrawBoxColor(Text:textcolor);
stock TextDrawSetShadow(Text:textsize);
stock TextDrawSetOutline(Text:textsize);
stock TextDrawBackgroundColor(Text:textcolor);
stock TextDrawFont(Text:textfont);
stock TextDrawSetProportional(Text:textset);
stock TextDrawSetSelectable(Text:textset);
stock TextDrawSetPos(Text:textFloat:xFloat:y);
stock TextDrawShowForPlayer(playeridText:text);
stock TextDrawHideForPlayer(playeridText:text);
stock TextDrawShowForAll(Text:text);
stock TextDrawHideForAll(Text:text);
stock TextDrawSetString(Text:textstring[]);
stock TextDrawSetPreviewModel(Text:textmodelindex);
stock TextDrawSetPreviewRot(Text:textFloat:fRotXFloat:fRotYFloat:fRotZFloat:fZoom 1.0);
stock TextDrawSetPreviewVehCol(Text:textcolor1color2);
stock bool:TextDrawGetLetterSize(Text:text, &Float:x, &Float:y);
stock bool:TextDrawGetTextSize(Text:text, &Float:x, &Float:y);
stock bool:TextDrawGetAlignment(Text:text, &alignment);
stock bool:TextDrawGetColor(Text:text, &color);
stock bool:TextDrawGetUseBox(Text:text, &bool:use);
stock bool:TextDrawGetBoxColor(Text:text, &color);
stock bool:TextDrawGetShadow(Text:text, &size);
stock bool:TextDrawGetOutline(Text:text, &size);
stock bool:TextDrawGetBackgroundColor(Text:text, &color);
stock bool:TextDrawGetFont(Text:text, &font);
stock bool:TextDrawGetProportional(Text:text, &bool:set);
stock bool:TextDrawGetSelectable(Text:text, &bool:set);
stock bool:TextDrawGetPos(Text:text, &Float:x, &Float:y);
stock bool:TextDrawGetString(Text:textstring[], size sizeof (string));
stock bool:TextDrawGetPreviewModel(Text:text, &modelindex);
stock bool:TextDrawGetPreviewRot(Text:text, &Float:fRotX, &Float:fRotY, &Float:fRotZ, &Float:fZoom 1.0);
stock bool:TextDrawGetPreviewVehCol(Text:text, &color1, &color2);
stock PlayerText:CreatePlayerTextDraw(playeridFloat:xFloat:ytext[]);
stock PlayerTextDrawDestroy(playeridPlayerText:text);
stock PlayerTextDrawLetterSize(playeridPlayerText:textFloat:xFloat:y);
stock PlayerTextDrawTextSize(playeridPlayerText:textFloat:xFloat:y);
stock PlayerTextDrawAlignment(playeridPlayerText:textalignment);
stock PlayerTextDrawColor(playeridPlayerText:textcolor);
stock PlayerTextDrawUseBox(playeridPlayerText:text, use);
stock PlayerTextDrawBoxColor(playeridPlayerText:textcolor);
stock PlayerTextDrawSetShadow(playeridPlayerText:textsize);
stock PlayerTextDrawSetOutline(playeridPlayerText:textsize);
stock PlayerTextDrawBackgroundColor(playeridPlayerText:textcolor);
stock PlayerTextDrawFont(playeridPlayerText:textfont);
stock PlayerTextDrawSetProportional(playeridPlayerText:textset);
stock PlayerTextDrawSetSelectable(playeridPlayerText:textset);
stock PlayerTextDrawSetPos(playeridPlayerText:textFloat:xFloat:y);
stock PlayerTextDrawShow(playeridPlayerText:text);
stock PlayerTextDrawHide(playeridPlayerText:text);
stock PlayerTextDrawSetString(playeridPlayerText:textstring[]);
stock PlayerTextDrawSetPreviewModel(playeridPlayerText:textmodelindex);
stock PlayerTextDrawSetPreviewRot(playeridPlayerText:textFloat:fRotXFloat:fRotYFloat:fRotZFloat:fZoom 1.0);
stock PlayerTextDrawSetPreviewVehCol(playeridPlayerText:textcolor1color2);
stock bool:PlayerTextDrawGetLetterSize(playeridPlayerText:text, &Float:x, &Float:y);
stock bool:PlayerTextDrawGetTextSize(playeridPlayerText:text, &Float:x, &Float:y);
stock bool:PlayerTextDrawGetAlignment(playeridPlayerText:text, &alignment);
stock bool:PlayerTextDrawGetColor(playeridPlayerText:text, &color);
stock bool:PlayerTextDrawGetUseBox(playeridPlayerText:text, &bool:use);
stock bool:PlayerTextDrawGetBoxColor(playeridPlayerText:text, &color);
stock bool:PlayerTextDrawGetShadow(playeridPlayerText:text, &size);
stock bool:PlayerTextDrawGetOutline(playeridPlayerText:text, &size);
stock bool:PlayerTDGetBackgroundColor(playeridPlayerText:text, &color);
stock bool:PlayerTextDrawGetFont(playeridPlayerText:text, &font);
stock bool:PlayerTextDrawGetProportional(playeridPlayerText:text, &bool:set);
stock bool:PlayerTextDrawGetSelectable(playeridPlayerText:text, &bool:set);
stock bool:PlayerTextDrawGetPos(playeridPlayerText:text, &Float:x, &Float:y);
stock bool:PlayerTextDrawGetString(playeridPlayerText:textstring[], size sizeof (string));
stock bool:PlayerTextDrawGetPreviewModel(playeridPlayerText:text, &modelindex);
stock bool:PlayerTextDrawGetPreviewRot(playeridPlayerText:text, &Float:fRotX, &Float:fRotY, &Float:fRotZ, &Float:fZoom 1.0);
stock bool:PlayerTextDrawGetPreviewVehCol(playeridPlayerText:text, &color1, &color2); 
OneDay is offline   Reply With Quote
Old 03/01/2018, 12:33 PM   #2
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,193
Reputation: 420
Default Re: Coloured Text Draws

Now i understand what you meant, but wasn't that possible through formatting a string and setting the textdraw's string?
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 03/01/2018, 12:36 PM   #3
OneDay
Huge Clucker
 
Join Date: Sep 2015
Posts: 294
Reputation: 139
Default Re: Coloured Text Draws

No. You can use ~g~ and ~r~ for colours, but not {00FF00} and {FF0000}. This: "{00FF00}Hello" becomes "?00FF00$Hello" and black before.
OneDay is offline   Reply With Quote
Old 03/01/2018, 12:59 PM   #4
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,193
Reputation: 420
Default Re: Coloured Text Draws

Quote:
Originally Posted by OneDay View Post
No. You can use ~g~ and ~r~ for colours, but not {00FF00} and {FF0000}. This: "{00FF00}Hello" becomes "?00FF00$Hello" and black before.
Ahaa, goodjob man this would be very useful when getting custom colors instead of using textdrawcolor, +rep in 24 hours... lol
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 03/01/2018, 06:02 PM   #5
Admireal
Big Clucker
 
Join Date: Sep 2016
Posts: 119
Reputation: 5
Default Re: Coloured Text Draws

Nice.
I will use.
Admireal is offline   Reply With Quote
Old 02/06/2018, 07:47 AM   #6
NatzuK
Little Clucker
 
NatzuK's Avatar
 
Join Date: Apr 2017
Location: Argentina.
Posts: 4
Reputation: 0
Default Re: Coloured Text Draws

Nice.
NatzuK is offline   Reply With Quote
Old 02/06/2018, 01:07 PM   #7
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,773
Reputation: 858
Default Re: Coloured Text Draws

I can see a good amount of effort put into this, good job!
__________________

Follow me on Github: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 03/06/2018, 08:05 AM   #8
Verc
Banned
 
Join Date: Apr 2018
Location: 🇯🇵
Posts: 171
Reputation: 42
Default Re: Coloured Text Draws

Do I have to change every textdraw that contains ~r~,~g~ or such to rgb code?
Verc is offline   Reply With Quote
Old 03/06/2018, 09:15 AM   #9
GTLS
High-roller
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 1,072
Reputation: 119
Default Re: Coloured Text Draws

Wait, I thought textdraws and GameText are different. I think they probably work on same logic but to be clear, This thread would be called Custom Colored GameText not textdraws as Textdraws already uses RGB format while GameText dont.
__________________

I don't help for rep. I help cuz I was helped in the past.


Retired from SAMP Scene. Might open SAMP Forums once in a while.

Some treats for ya. Click em
Basic House System
Simple Speedo
Base Login/Register Script

GTLS is offline   Reply With Quote
Old 03/06/2018, 10:42 AM   #10
almiighty
Banned
 
Join Date: May 2018
Posts: 5
Reputation: 0
Default Re: Coloured Text Draws

Quote:
Originally Posted by GTLS View Post
Wait, I thought textdraws and GameText are different. I think they probably work on same logic but to be clear, This thread would be called Custom Colored GameText not textdraws as Textdraws already uses RGB format while GameText dont.
are you dumb?

No. You can use ~g~ and ~r~ for colours, but not {00FF00} and {FF0000}. This: "{00FF00}Hello" becomes "?00FF00$Hello" and black before.
almiighty is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Draws !! rockhopper Scripting Help 4 08/05/2014 03:28 PM
Text-Draws Help. Youice Scripting Help 0 30/05/2012 08:44 AM
[Include] Coloured Chat Text [2 Versions] RyDeR` Includes 52 24/08/2011 11:21 AM
how do i get coloured text in the middle of sentences Deal-or-die Help Archive 8 23/03/2011 10:03 PM
Text Draws Geekzor Help Archive 6 09/08/2009 12:17 PM


All times are GMT. The time now is 01:08 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.