Problem with textdraw box
#1

Hi guys. I got a problem with textdraw box, it's just going off the screen... Height is ok, but the width is much too big.

It looks like that:


My code:
pawn Код:
PlayerData[playerid][TD_Speedometer] = TextDrawCreate(512.000000, 357.000000, "Speed: 50 km/h ~n~test");
    TextDrawBackgroundColor(PlayerData[playerid][TD_Speedometer], 255);
    TextDrawFont(PlayerData[playerid][TD_Speedometer], 1);
    TextDrawLetterSize(PlayerData[playerid][TD_Speedometer], 0.340000, 1.600000);
    TextDrawColor(PlayerData[playerid][TD_Speedometer], -1);
    TextDrawSetOutline(PlayerData[playerid][TD_Speedometer], 0);
    TextDrawSetProportional(PlayerData[playerid][TD_Speedometer], 1);
    TextDrawSetShadow(PlayerData[playerid][TD_Speedometer], 1);
   
    PlayerData[playerid][TD_Speedometer_Bg] = TextDrawCreate(512.000000, 357.000000, "~n~~n~~n~~n~");
    TextDrawLetterSize(PlayerData[playerid][TD_Speedometer_Bg], 0.340000, 1.600000);
    TextDrawUseBox(PlayerData[playerid][TD_Speedometer_Bg],1);
    TextDrawBoxColor(PlayerData[playerid][TD_Speedometer_Bg], 0x00000044);
I need to do the text and the background in other textdraws, because many features will be added next. How can I fix the box's width?
Reply
#2

TextDrawAlignment(MyTextdraw, 2);

Add this.

//Edit: And use "Zamaroht's TextDraw Editor"
Reply
#3

I tried to use it, but the boxes are messed up there, when I add a box it's on the left side of the text instead of behind it :/

Now the box goes through the whole screen...
Reply
#4

Let me start with what your doing wrong.

1.) Wrong type of textdraw you need to use player textdraws https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
2.) Use Zamaroht's TextDraw Editor turn the box on and edit the size of the box (Make sure your alignment is left)
3.) Export as PLAYERTEXTDRAW
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)