Textdraw Background Transparency?
#1

Hi,

So I have this:
pawn Код:
PocketSlot[playerid][i] = CreatePlayerTextDraw(playerid, 180.000000, 390.000000, "_");
PlayerTextDrawFont(playerid, PocketSlot[playerid][i], TEXT_DRAW_FONT_MODEL_PREVIEW);
PlayerTextDrawUseBox(playerid, PocketSlot[playerid][i], 1);
PlayerTextDrawBoxColor(playerid, PocketSlot[playerid][i], 0x00000096);
PlayerTextDrawTextSize(playerid, PocketSlot[playerid][i], 50.000000, 50.000000);
PlayerTextDrawSetPreviewModel(playerid, PocketSlot[playerid][i], 2601);
PlayerTextDrawSetPreviewRot(playerid, PocketSlot[playerid][i], -10.0, 0.0, -20.0, 1.0);
PlayerTextDrawSetSelectable(playerid, PocketSlot[playerid][i], 0);
And for some reason, no matter what I set the colour to, it is always a big black square. I even tried setting it to a blue square and it still appeared as a black one. Ideally I want a slightly transparent black square. But I don't want to just fix this problem, I want to understand where I am going wrong.

I hope this makes sense.

Warm Regards

Matt
Reply
#2

https://sampwiki.blast.hk/wiki/PlayerTextDrawColor

PlayerTextDrawColor in 0
Reply
#3

Try,

pawn Код:
PlayerTextDrawBoxColor(playerid, PocketSlot[playerid], 102);
Reply
#4

Hello,

Thank for your prompt responses, however, it did not solve the problem, it did make the block become transparent when I did this code:
pawn Код:
PocketSlot[playerid][i] = CreatePlayerTextDraw(playerid, 180.000000, 390.000000, "_");
PlayerTextDrawFont(playerid, PocketSlot[playerid][i], TEXT_DRAW_FONT_MODEL_PREVIEW);
PlayerTextDrawUseBox(playerid, PocketSlot[playerid][i], 1);
PlayerTextDrawTextSize(playerid, PocketSlot[playerid][i], 50.000000, 50.000000);
PlayerTextDrawBoxColor(playerid, PocketSlot[playerid][i], 0x000000);
PlayerTextDrawColor(playerid, PocketSlot[playerid][i], 150);
PlayerTextDrawSetPreviewModel(playerid, PocketSlot[playerid][i], 2601);
PlayerTextDrawSetPreviewRot(playerid, PocketSlot[playerid][i], -10.0, 0.0, -20.0, 1.0);
PlayerTextDrawSetSelectable(playerid, PocketSlot[playerid][i], 0);
But as much as it made the block become transparent, it hid the entire Model (Object 2601) so it's basically a blank block.
Reply
#5

Nvm.
Reply
#6

No, I want it to be slightly opaque (which it is) but the object disappears when I make it so.
Reply
#7

Quote:
Originally Posted by Shoulen
Посмотреть сообщение
No, I want it to be slightly opaque (which it is) but the object disappears when I make it so.
Remove,

pawn Код:
PlayerTextDrawColor(playerid, PocketSlot[playerid][i], 150);
Reply
#8

Quote:
Originally Posted by AlonzoTorres
Посмотреть сообщение
Remove,

pawn Код:
PlayerTextDrawColor(playerid, PocketSlot[playerid][i], 150);
It just made it black with no opacity, the object is there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)