White spaces in textdraw
#1

Hey, I'm trying to use ~n~ in my textdraw, but apparently, after it is added into the textdraw string, a little malfunction seems to appear (you can see in the photo below). Any ideas?



Textdraw code:
pawn Код:
td_radio_info2[ playerid ] = CreatePlayerTextDraw( playerid, 549.923486, 106.850000, "~b~radio info~n~chan: ~g~0~n~~b~slot: ~g~0" ) ; // NON-COLOR
    PlayerTextDrawLetterSize( playerid, td_radio_info2[ playerid ], 0.484498, 1.113124 ) ;
    PlayerTextDrawAlignment( playerid, td_radio_info2[ playerid ], 2 ) ;
    PlayerTextDrawColor( playerid, td_radio_info2[ playerid ], 255 ) ;
    PlayerTextDrawSetShadow( playerid, td_radio_info2[ playerid ], 0 ) ;
    PlayerTextDrawSetOutline( playerid, td_radio_info2[ playerid ], 0 ) ;
    PlayerTextDrawBackgroundColor( playerid, td_radio_info2[ playerid ], 51 ) ;
    PlayerTextDrawFont( playerid, td_radio_info2[ playerid ], 3 ) ;
    PlayerTextDrawSetProportional( playerid, td_radio_info2[ playerid ], 1 ) ;

    td_radio_info1[ playerid ] = CreatePlayerTextDraw( playerid, 548.000000, 105.000000, "radio info~n~chan: 0~n~slot: 0" ) ; // COLOR
    PlayerTextDrawLetterSize( playerid, td_radio_info1[ playerid ], 0.474998, 1.104373 ) ;
    PlayerTextDrawAlignment( playerid, td_radio_info1[ playerid ], 2 ) ;
    PlayerTextDrawColor( playerid, td_radio_info1[ playerid ], -1 ) ;
    PlayerTextDrawSetShadow( playerid, td_radio_info1[ playerid ], 0 ) ;
    PlayerTextDrawSetOutline( playerid, td_radio_info1[ playerid ], 0 ) ;
    PlayerTextDrawBackgroundColor( playerid, td_radio_info1[ playerid ], 51 ) ;
    PlayerTextDrawFont( playerid, td_radio_info1[ playerid ], 3 ) ;
    PlayerTextDrawSetProportional( playerid, td_radio_info1[ playerid ], 1 ) ;
Reply
#2

Quote:
Originally Posted by AidanRO
Посмотреть сообщение
Hey, I'm trying to use ~n~ in my textdraw, but apparently, after it is added into the textdraw string, a little malfunction seems to appear (you can see in the photo below). Any ideas?



Textdraw code:
pawn Код:
td_radio_info2[ playerid ] = CreatePlayerTextDraw( playerid, 549.923486, 106.850000, "~b~radio info~n~chan: ~g~0~n~~b~slot: ~g~0" ) ; // NON-COLOR
    PlayerTextDrawLetterSize( playerid, td_radio_info2[ playerid ], 0.484498, 1.113124 ) ;
    PlayerTextDrawAlignment( playerid, td_radio_info2[ playerid ], 2 ) ;
    PlayerTextDrawColor( playerid, td_radio_info2[ playerid ], 255 ) ;
    PlayerTextDrawSetShadow( playerid, td_radio_info2[ playerid ], 0 ) ;
    PlayerTextDrawSetOutline( playerid, td_radio_info2[ playerid ], 0 ) ;
    PlayerTextDrawBackgroundColor( playerid, td_radio_info2[ playerid ], 51 ) ;
    PlayerTextDrawFont( playerid, td_radio_info2[ playerid ], 3 ) ;
    PlayerTextDrawSetProportional( playerid, td_radio_info2[ playerid ], 1 ) ;

    td_radio_info1[ playerid ] = CreatePlayerTextDraw( playerid, 548.000000, 105.000000, "radio info~n~chan: 0~n~slot: 0" ) ; // COLOR
    PlayerTextDrawLetterSize( playerid, td_radio_info1[ playerid ], 0.474998, 1.104373 ) ;
    PlayerTextDrawAlignment( playerid, td_radio_info1[ playerid ], 2 ) ;
    PlayerTextDrawColor( playerid, td_radio_info1[ playerid ], -1 ) ;
    PlayerTextDrawSetShadow( playerid, td_radio_info1[ playerid ], 0 ) ;
    PlayerTextDrawSetOutline( playerid, td_radio_info1[ playerid ], 0 ) ;
    PlayerTextDrawBackgroundColor( playerid, td_radio_info1[ playerid ], 51 ) ;
    PlayerTextDrawFont( playerid, td_radio_info1[ playerid ], 3 ) ;
    PlayerTextDrawSetProportional( playerid, td_radio_info1[ playerid ], 1 ) ;
white line?
Reply
#3

change the textdraw background color to transparent color
Код:
PlayerTextDrawBackgroundColor( playerid, td_radio_info2[ playerid ], 0x00000000 ) ;
also do that for td_radio_info1[ playerid ]
Reply
#4

It didn't work. Look at the photo and you'll see the white squares and you'll know what I'm talking about.
Reply
#5

Quote:
Originally Posted by AidanRO
Посмотреть сообщение
It didn't work. Look at the photo and you'll see the white squares and you'll know what I'm talking about.
maybe it's from the speedometer?
Reply
#6

Quote:
Originally Posted by ForCop
Посмотреть сообщение
maybe it's from the speedometer?
It doesn't have any connection to the speedometer. I show it or not, the white squares still appear because of the ~n~'s.
Reply
#7

Quote:
Originally Posted by AidanRO
Посмотреть сообщение
It doesn't have any connection to the speedometer. I show it or not, the white squares still appear because of the ~n~'s.
PlayerTextDrawColor( playerid, td_radio_info1[ playerid ], -1 ) ;
PlayerTextDrawBackgroundColor( playerid, td_radio_info1[ playerid ], 51 ) ;

try without these functions ... something else I do not know.
Reply
#8

Still no result.
Reply
#9

These glitches mostly appear when there are either unsupported signs/unmatched codes (eg. "~r") in the Text or if there's a space (or underscore) at the very end. This can also happen with one of the Fonts if the String is completely empty).

For testing you could print the TextDraw String to the console to see the actual signs (since textdraws do not show all characters correctly).

If you are unsure show us the plain text of the TextDraw here.
Reply
#10

The printed string of the textdraw after adding the ~n~'s:

Код:
info_td_msg1[ 0 ]: ~N~~N~~N~~b~radio info~n~chan: ~g~0~n~~b~slot: ~g~0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)