Textdraws testen

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Servus,


    kann mal eben jemand diese Textdraws testen, ob die anklickbar sind ?
    Sie sollten eigentlich gehen.
    Bei mir nämlich komischerweise nicht...



    new PlayerText:RightButton[MAX_PLAYERS];
    new PlayerText:LeftButton[MAX_PLAYERS];
    new PlayerText:UseButton[MAX_PLAYERS];
    new PlayerText:DropButton[MAX_PLAYERS];


    Inhalt anzeigen

    public OnPlayerConnect(playerid)
    {
    UseButton[playerid] = CreatePlayerTextDraw(playerid,192.000000, 300.000000, "Benutzen");
    PlayerTextDrawBackgroundColor(playerid,UseButton[playerid], 255);
    PlayerTextDrawFont(playerid,UseButton[playerid], 2);
    PlayerTextDrawLetterSize(playerid,UseButton[playerid], 0.180000, 0.899998);
    PlayerTextDrawColor(playerid,UseButton[playerid], -1);
    PlayerTextDrawSetOutline(playerid,UseButton[playerid], 0);
    PlayerTextDrawSetProportional(playerid,UseButton[playerid], 1);
    PlayerTextDrawSetShadow(playerid,UseButton[playerid], 1);
    PlayerTextDrawTextSize(playerid,UseButton[playerid],50.000000, 10.000000);
    PlayerTextDrawSetSelectable(playerid,UseButton[playerid], 1);

    Inhalt anzeigen

    Inhalt anzeigen
    DropButton[playerid] = CreatePlayerTextDraw(playerid,188.000000, 320.000000, "Wegwerfen");
    PlayerTextDrawBackgroundColor(playerid,DropButton[playerid], 255);
    PlayerTextDrawFont(playerid,DropButton[playerid], 2);
    PlayerTextDrawLetterSize(playerid,DropButton[playerid], 0.180000, 0.899998);
    PlayerTextDrawColor(playerid,DropButton[playerid], -1);
    PlayerTextDrawSetOutline(playerid,DropButton[playerid], 0);
    PlayerTextDrawSetProportional(playerid,DropButton[playerid], 1);
    PlayerTextDrawSetShadow(playerid,DropButton[playerid], 1);
    PlayerTextDrawTextSize(playerid,DropButton[playerid],50.000000, 10.000000);
    PlayerTextDrawSetSelectable(playerid,DropButton[playerid], 1);

    Inhalt anzeigen

    Inhalt anzeigen
    RightButton[playerid] = CreatePlayerTextDraw(playerid,248.000000, 266.000000, ">");
    PlayerTextDrawBackgroundColor(playerid,RightButton[playerid], 255);
    PlayerTextDrawFont(playerid,RightButton[playerid], 2);
    PlayerTextDrawLetterSize(playerid,RightButton[playerid], 0.219999, 1.199998);
    PlayerTextDrawColor(playerid,RightButton[playerid], -16776961);
    PlayerTextDrawSetOutline(playerid,RightButton[playerid], 0);
    PlayerTextDrawSetProportional(playerid,RightButton[playerid], 1);
    PlayerTextDrawSetShadow(playerid,RightButton[playerid], 0);
    PlayerTextDrawTextSize(playerid,RightButton[playerid],5.000000, 5.000000);
    PlayerTextDrawSetSelectable(playerid,RightButton[playerid], 1);

    LeftButton[playerid] = CreatePlayerTextDraw(playerid,218.000000, 266.000000, "<");
    PlayerTextDrawBackgroundColor(playerid,LeftButton[playerid], 255);
    PlayerTextDrawFont(playerid,LeftButton[playerid], 2);
    PlayerTextDrawLetterSize(playerid,LeftButton[playerid], 0.219999, 1.199998);
    PlayerTextDrawColor(playerid,LeftButton[playerid], -16776961);
    PlayerTextDrawSetOutline(playerid,LeftButton[playerid], 0);
    PlayerTextDrawSetProportional(playerid,LeftButton[playerid], 1);
    PlayerTextDrawSetShadow(playerid,LeftButton[playerid], 0);
    PlayerTextDrawTextSize(playerid,LeftButton[playerid],5.000000, 5.000000);
    PlayerTextDrawSetSelectable(playerid,LeftButton[playerid], 1);
    }

    Inhalt anzeigen

    Inhalt anzeigen


    Inhalt anzeigen

    Inhalt anzeigen

    Inhalt anzeigen
    public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
    {
    if(playertextid == RightButton[playerid])
    {
    SendClientMessage(playerid,WEIß,"Jo");

    SetPVarInt(playerid,"InvSite",GetPVarInt(playerid,"InvSite")+1);
    new string[128];
    format(string,sizeof(string),"%d",GetPVarInt(playerid,"InvSite"));
    SendClientMessage(playerid,WEIß,string);
    UpdateInventory(playerid);
    return 1;

    Inhalt anzeigen

    Inhalt anzeigen
    }
    else if(playertextid == LeftButton[playerid])
    {
    SendClientMessage(playerid,WEIß,"Jo");

    SetPVarInt(playerid,"InvSite",GetPVarInt(playerid,"InvSite")-1);
    new string[128];
    format(string,sizeof(string),"%d",GetPVarInt(playerid,"InvSite"));
    SendClientMessage(playerid,WEIß,string);
    if(GetPVarInt(playerid,"InvSite")<0)SetPVarInt(playerid,"InvSite",0);
    UpdateInventory(playerid);
    return 1;

    Inhalt anzeigen

    Inhalt anzeigen
    }
    else if(playertextid == DropButton[playerid])
    {
    SendClientMessage(playerid,WEIß,"Jo");
    return 1;
    }
    else if(playertextid == UseButton[playerid])
    {
    SendClientMessage(playerid,WEIß,"Jo");
    return 1;
    }

    Inhalt anzeigen

    Inhalt anzeigen
    return 1;
    }

    Inhalt anzeigen

    Inhalt anzeigen

    Schau doch mal auf Inf-Reallife vorbei ! - Wir entwickeln einen großartigen GTA:Network Server

  • Du hast vergessen eine Box für das Textdraw was anklickbar sein soll zu erstellen.
    Wenn du die Box nicht sichtbar machen möchtest, musst du die BoxColor auf 0, bzw. 0x00000000 stellen

  • Zeig uns mal deinen Code vom TextDraw, vielleicht hast du die TextSize falsch eingestellt.

  • S_Weiter = TextDrawCreate(328.000000, 313.000000, "Weiter");
    TextDrawBackgroundColor(S_Weiter, 255);
    TextDrawFont(S_Weiter, 1);
    TextDrawLetterSize(S_Weiter, 0.270000, 1.000000);
    TextDrawColor(S_Weiter, -1);
    TextDrawSetOutline(S_Weiter, 1);
    TextDrawSetProportional(S_Weiter, 1);
    TextDrawUseBox(S_Weiter, 1);
    TextDrawBoxColor(S_Weiter, 0);
    TextDrawTextSize(S_Weiter, 358.000000, 0.000000);


    S_Back = TextDrawCreate(277.000000, 313.000000, "Zurueck");
    TextDrawBackgroundColor(S_Back, 255);
    TextDrawFont(S_Back, 1);
    TextDrawLetterSize(S_Back, 0.270000, 1.000000);
    TextDrawColor(S_Back, -1);
    TextDrawSetOutline(S_Back, 1);
    TextDrawSetProportional(S_Back, 1);
    TextDrawUseBox(S_Back, 1);
    TextDrawBoxColor(S_Back, 0);
    TextDrawTextSize(S_Back, 313.000000, 0.000000);

  • TextDrawTextSize(S_Weiter, 358.000000, 0.000000);
    zu
    TextDrawTextSize(S_Weiter, 358.000000, 10.000000);
    Mit 0.0000 kann das nicht gehen ;)