Can't select textdraw
#1

Hello,

I cannot select a textdraw I created, when I hover the mouse over it, the color changes. But when I click it, OnPlayerClickTextdraw gets called, but action for the textdraw isn't performed.


I create it like this:
pawn Код:
Furniture_Mode[playerid][0] = TextDrawCreate(360.0,372.0,"LD_POOL:ball");
    Furniture_Mode[playerid][1] = TextDrawCreate(360.0,389.0,"LD_POOL:ball");
    for(new i; i < 2; i++)
    {
        TextDrawFont(Furniture_Mode[playerid][i],4);
        TextDrawTextSize(Furniture_Mode[playerid][i],15.0,15.0);
        TextDrawSetSelectable(Furniture_Mode[playerid][i],1);
    }
And OnPlayerClickTextdraw
pawn Код:
if(clickedid == Furniture_Mode[playerid][0])
    {
        printf("it is here");
        SendClientMessage(playerid,RED,"Number 0 is selected");
        set.IsMovingObject[playerid] = true;
        set.IsRotatingObject[playerid] = false;
        TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][0]);
        TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][1]);
        TextDrawColor(Furniture_Mode[playerid][0],0xFF0000FF);
        TextDrawColor(Furniture_Mode[playerid][1],0xFFFFFFFF);
        TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][0]);
        TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][1]);
        return 1;
    }
    if(clickedid == Furniture_Mode[playerid][1])
    {
        SendClientMessage(playerid,RED,"Number 1 is selected");
        set.IsRotatingObject[playerid] = true;
        set.IsMovingObject[playerid] = false;
        TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][0]);
        TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][1]);
        TextDrawColor(Furniture_Mode[playerid][0],0xFFFFFFFF);
        TextDrawColor(Furniture_Mode[playerid][1],0xFF0000FF);
        TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][0]);
        TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][1]);
        return 1;
    }

As you noticed there are two textdraws that are created identically. The weirdest part that the one with index 1 is working just fine.

That part "It is here" never gets printed.
Reply
#2

bump
Reply
#3

bump, once more.
Reply
#4

bump. Still an issue.
Reply
#5

A fourth bump, wow. No ideas, really?

Oh and I tried deleting the working one.. Problem didn't delete with it


EDIT: sorry for the early bump... Due to timezone differene it's hard for me to track forums time..
Reply
#6

pawn Код:
for(new i; i < 2; i++)
    {
        TextDrawFont(Furniture_Mode[playerid][i],4);
        TextDrawTextSize(Furniture_Mode[playerid][i],15.0,15.0);
        TextDrawSetSelectable(Furniture_Mode[playerid][i],1);
    }
The clickable areas overlap of course so only the last textdraw would work.
Reply
#7

How do you mean?
Reply
#8

TextDrawTextSize(Furniture_Mode[playerid][i],15.0,15.0);
Reply
#9

But if I change the TextSize the sizeof the textdraw changes aswell...

What area should set it to anyway?
Reply
#10

Okay I guess this is my current question: can I change the clickable are for a txd model without changing it's size?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)