Textdraw don't want to change color
#1

Hi, I have some problem with SelectTextDraw(playerid,color);

I have created txtdraw :

Код:
userpanel = TextDrawCreate(0,428,"User panel");
TextDrawLetterSize(userpanel,1.000000,2.000000);
TextDrawAlignment(userpanel,0);
TextDrawBackgroundColor(userpanel,0x000000FF);
TextDrawFont(userpanel,0);
TextDrawUseBox(userpanel,1);
TextDrawBoxColor(userpanel,0x000000FF);
TextDrawTextSize(userpanel,700.000000,438.000000);
TextDrawSetOutline(userpanel,0);
TextDrawSetProportional(userpanel,1);
TextDrawSetShadow(userpanel,1);
In OnPlayerconnect :

Код:
PlayerTextDrawSetSelectable(playerid,PlayerText:userpanel[playerid],1);
   TextDrawShowForPlayer(playerid,userpanel[playerid]);
and in keystatechange :

Код:
if((newkeys & (KEY_FIRE | KEY_LOOK_BEHIND)) == (KEY_FIRE | KEY_LOOK_BEHIND)){
    SelectTextDraw(playerid,0xFF4040AA);
   }
But when I press CTRL+ NUM1 and set cursor on textdraw, textdraw is still white
Reply
#2

You're not creating the textdraw as a player textdraw. There are different functions for it.

TextDrawCreate should be CreatePlayerTextDraw.

TextDrawShowForPlayer should be PlayerTextDrawShow

The others should have 'Player' behind them and the first parameter should be playerid.
Reply
#3

I 'think' you need to hide and show the textdraw again, for the colour to updated.
Reply
#4

Quote:
Originally Posted by Rac3r
Посмотреть сообщение
I 'think' you need to hide and show the textdraw again, for the colour to updated.
Yea u do.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)