Selectables Textdraws Problem(e)

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
  • Ich hab die Screens vom Problem im Expander:
    (DIe Maus wurde n icht mit aufgenommen, also hab ich mal versucht ihre ungefaehre position einzuzeichnen.)


    Hier der Code:

    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == DIALOG_FBI_SKIN_CHANGE)
    {
    if(response == 1)
    {
    //Textdraw 1
    usebox_fbi_skin = TextDrawCreate(417.500000, 349.166687, "usebox");
    TextDrawLetterSize(usebox_fbi_skin, 0.000000, 4.816664);
    TextDrawTextSize(usebox_fbi_skin, 240.000000, 0.000000);
    TextDrawAlignment(usebox_fbi_skin, 1);
    TextDrawColor(usebox_fbi_skin, 0);
    TextDrawUseBox(usebox_fbi_skin, true);
    TextDrawBoxColor(usebox_fbi_skin, 255);
    TextDrawSetShadow(usebox_fbi_skin, 0);
    TextDrawSetOutline(usebox_fbi_skin, 0);
    TextDrawBackgroundColor(usebox_fbi_skin, -2139062017);
    TextDrawFont(usebox_fbi_skin, 0);
    //Textdraw 2
    rechts_fbi_skin = TextDrawCreate(310.000000, 364.933441, ">>");
    TextDrawLetterSize(rechts_fbi_skin, 0.449999, 1.600000);
    TextDrawAlignment(rechts_fbi_skin, 1);
    TextDrawColor(rechts_fbi_skin, -1);
    TextDrawSetShadow(rechts_fbi_skin, 0);
    TextDrawSetOutline(rechts_fbi_skin, 1);
    TextDrawBackgroundColor(rechts_fbi_skin, 51);
    TextDrawFont(rechts_fbi_skin, 1);
    TextDrawSetProportional(rechts_fbi_skin, 1);
    //Textdraw 3
    links_fbi_skin = TextDrawCreate(260.000000, 363.999877, "<<");
    TextDrawLetterSize(links_fbi_skin, 0.449999, 1.600000);
    TextDrawAlignment(links_fbi_skin, 1);
    TextDrawColor(links_fbi_skin, -1);
    TextDrawSetShadow(links_fbi_skin, 0);
    TextDrawSetOutline(links_fbi_skin, -1);
    TextDrawBackgroundColor(links_fbi_skin, 51);
    TextDrawFont(links_fbi_skin, 1);
    TextDrawSetProportional(links_fbi_skin, 1);
    //Textdraw 4
    set_fbi_skin = TextDrawCreate(353.000000, 364.466705, "SET");
    TextDrawLetterSize(set_fbi_skin, 0.449999, 1.600000);
    TextDrawAlignment(set_fbi_skin, 1);
    TextDrawColor(set_fbi_skin, -1);
    TextDrawSetShadow(set_fbi_skin, 0);
    TextDrawSetOutline(set_fbi_skin, -1);
    TextDrawBackgroundColor(set_fbi_skin, 51);
    TextDrawFont(set_fbi_skin, 1);
    TextDrawSetProportional(set_fbi_skin, 1);
    TogglePlayerControllable(playerid,0);
    SetPlayerPos(playerid,967.1509,1683.9474,8.8516);
    SetPlayerFacingAngle(playerid,270.0);
    SetPlayerCameraPos(playerid,973.1503,1684.1062,9.6484);
    SetPlayerCameraLookAt(playerid,967.1509,1683.9474,8.8516);
    SetPlayerSkin(playerid,8);
    TextDrawShowForPlayer(playerid,usebox_fbi_skin);
    TextDrawShowForPlayer(playerid,rechts_fbi_skin);
    TextDrawShowForPlayer(playerid,links_fbi_skin);
    TextDrawShowForPlayer(playerid,set_fbi_skin);
    TextDrawSetSelectable(usebox_fbi_skin,false);
    TextDrawSetSelectable(rechts_fbi_skin,true);
    TextDrawSetSelectable(links_fbi_skin,true);
    TextDrawSetSelectable(set_fbi_skin,true);
    SelectTextDraw(playerid,0x00FF00FF);
    }
    else{SendClientMessage(playerid,weiss,"Du hast dir keine Tarnung angezogen.");}
    }
    return 1;
    }


    E\: Ist wohl niemand da ist der genug von Pawn versteht um mir zu helfen.


    xXSeXyBreaDXx -> BREAD. -> [LoG]Bread -> Bread

    Einmal editiert, zuletzt von Bread ()

  • du musst textdraw textsize dementsprechend einstellen
    fuer die hoehe ist die y achse verantwortlich dort den dementsprechenden wert eintragen fuer die x koordinate tragst du x position der textdraws ein plus x einheiten deiner wahl,welche die breite deines auswahlfeldes bestimmt. die grosssen duerfen niemals negativ sein oder die xbposition kleiner als die des textdraws

  • Wenn's klappt kriegst du die hilfreicheste Antwort.


    Um noch was zu ergänzen da ich noch gestern kurz mit dem Handy online war als beispiel
    nehmen wir mal das ]rechts_fbi_skin Textdraw
    rechts_fbi_skin = TextDrawCreate(310.000000, 364.933441, ">>");


    Dort fügst du dies noch hinzu
    TextDrawTextSize(usebox_fbi_skin, 310.000000+20, 10.000000);


    wie man hier gut erkennen kann benötig man nicht die y-koordinate also 364.933441 des Textdraws sondern kann dies ganz einfach rein schreiben was jedoch bei der
    x-koordinate nicht der fall ist daher addiert man hier die breite des auswahlbereiches an. Du kannst es wie im beispiel machen oder einfach 330.0 schreiben
    das ist das selbe. Wie schon oben angemerkt darf TextDrawTextSize nicht 0 , negativ oder nur bei der x-achse kleiner als die x-koordinate des Textdraws sein.


    Das bedeutet:
    TextDrawTextSize(usebox_fbi_skin, 310.000000+20, 0.000000);


    TextDrawTextSize(usebox_fbi_skin, 310.000000+20, -10.000000);


    ´TextDrawTextSize(usebox_fbi_skin, 300.000000, 10.000000);


    TextDrawTextSize(usebox_fbi_skin, 0.000000, 10.000000);


    TextDrawTextSize(usebox_fbi_skin, -1.000000, 10.000000);


    sind FALSCH beziehungsweise du kannst das Textdraw nicht mehr anklicken.


    Jedoch gillt diese regeln nicht für sprites sondern einzigallein für Texte meines erachtens


    Bestes beispiel aus meiner einen include


    Navigation{2} = TextDrawCreate(542.000000, 228.375000, "ld_beat:down");
    TextDrawLetterSize(Navigation{2}, 0.000000, 0.000000);
    TextDrawTextSize(Navigation{2}, 15.000000, 17.500000);
    TextDrawAlignment(Navigation{2}, 1);
    TextDrawColor(Navigation{2}, -1);
    TextDrawSetShadow(Navigation{2}, 0);
    TextDrawSetOutline(Navigation{2}, 0);
    TextDrawFont(Navigation{2}, 4);
    TextDrawSetSelectable(Navigation{2}, true);


    Navigation{1} = TextDrawCreate(498.000000, 119.437500, "Further");
    TextDrawLetterSize(Navigation{1}, 0.250499, 1.490625);
    TextDrawTextSize(Navigation{1}, 606.500000, 20.562500);
    TextDrawAlignment(Navigation{1}, 1);
    TextDrawColor(Navigation{1}, -1);
    TextDrawUseBox(Navigation{1}, true);
    TextDrawBoxColor(Navigation{1}, 80);
    TextDrawSetShadow(Navigation{1}, 0);
    TextDrawSetOutline(Navigation{1}, 1);
    TextDrawBackgroundColor(Navigation{1}, 51);
    TextDrawFont(Navigation{1}, 2);
    TextDrawSetProportional(Navigation{1}, 1);
    TextDrawSetSelectable(Navigation{1}, true);


    Bei dem sprite musste ich nichts zur poition bei TextDrawTextSize dazu addieren bei der x koordinate bei dem Text Further was weiter bedeutet jedoch schon.

  • Ich glaub ich hab das ganze nicht richtig verstanden:



    Screen wie es jz aussieht:



    Mein Code bs jz:

    Spoiler anzeigen
    //Textdraw 1
    usebox_fbi_skin = TextDrawCreate(417.5, 349.166687, "usebox");
    TextDrawLetterSize(usebox_fbi_skin, 0.0, 4.816664);
    TextDrawTextSize(usebox_fbi_skin, 310.0+20.0, 0.0);
    TextDrawAlignment(usebox_fbi_skin, 1);
    TextDrawColor(usebox_fbi_skin, 0);
    TextDrawUseBox(usebox_fbi_skin, true);
    TextDrawBoxColor(usebox_fbi_skin, 255);
    TextDrawSetShadow(usebox_fbi_skin, 0);
    TextDrawSetOutline(usebox_fbi_skin, 0);
    TextDrawBackgroundColor(usebox_fbi_skin, -2139062017);
    TextDrawFont(usebox_fbi_skin, 0);
    //Textdraw 2
    rechts_fbi_skin = TextDrawCreate(310.000000, 364.933441, ">>");
    TextDrawLetterSize(rechts_fbi_skin, 0.449999, 1.6);
    TextDrawTextSize(rechts_fbi_skin, 310.0+20.0, 1.866667);
    TextDrawAlignment(rechts_fbi_skin, 1);
    TextDrawColor(rechts_fbi_skin, -1);
    TextDrawSetShadow(rechts_fbi_skin, 0);
    TextDrawSetOutline(rechts_fbi_skin, 1);
    TextDrawBackgroundColor(rechts_fbi_skin, 51);
    TextDrawFont(rechts_fbi_skin, 1);
    TextDrawSetProportional(rechts_fbi_skin, 1);
    //Textdraw 3
    links_fbi_skin = TextDrawCreate(260.0, 363.999877, "<<");
    TextDrawLetterSize(links_fbi_skin, 0.449999, 1.6);
    TextDrawTextSize(links_fbi_skin, 260.0, -195.532882);
    TextDrawAlignment(links_fbi_skin, 1);
    TextDrawColor(links_fbi_skin, -1);
    TextDrawSetShadow(links_fbi_skin, 0);
    TextDrawSetOutline(links_fbi_skin, -1);
    TextDrawBackgroundColor(links_fbi_skin, 51);
    TextDrawFont(links_fbi_skin, 1);
    TextDrawSetProportional(links_fbi_skin, 1);
    TextDrawSetSelectable(links_fbi_skin, true);
    //Textdraw 4
    set_fbi_skin = TextDrawCreate(353.0, 364.466705, "SET");
    TextDrawLetterSize(set_fbi_skin, 0.449999, 1.6);
    TextDrawTextSize(set_fbi_skin, 353.0+20, -28.000011);
    TextDrawAlignment(set_fbi_skin, 1);
    TextDrawColor(set_fbi_skin, -1);
    TextDrawSetShadow(set_fbi_skin, 0);
    TextDrawSetOutline(set_fbi_skin, -1);
    TextDrawBackgroundColor(set_fbi_skin, 51);
    TextDrawFont(set_fbi_skin, 1);
    TextDrawSetProportional(set_fbi_skin, 1);


    xXSeXyBreaDXx -> BREAD. -> [LoG]Bread -> Bread

    Einmal editiert, zuletzt von Bread () aus folgendem Grund: Code erstetzt

  • Hier bitte


    new Text:Skin_Selection[4 char];

    Skin_Selection{0} = TextDrawCreate(417.500000, 349.166687, "usebox");
    TextDrawLetterSize(Skin_Selection{0}, 0.000000, 4.816664);
    TextDrawTextSize(Skin_Selection{0}, 240.000000, 0.000000);
    TextDrawAlignment(Skin_Selection{0}, 1);
    TextDrawColor(Skin_Selection{0}, 0);
    TextDrawUseBox(Skin_Selection{0}, true);
    TextDrawBoxColor(Skin_Selection{0}, 255);
    TextDrawSetShadow(Skin_Selection{0}, 0);
    TextDrawSetOutline(Skin_Selection{0}, 0);
    TextDrawBackgroundColor(Skin_Selection{0}, -2139062017);
    TextDrawFont(Skin_Selection{0}, 0);

    Skin_Selection{1} = TextDrawCreate(260.000000, 364.000000, "<<");
    TextDrawLetterSize(Skin_Selection{1}, 0.449999, 1.600000);
    TextDrawTextSize(Skin_Selection{1}, 282.000000, 10.0);
    TextDrawAlignment(Skin_Selection{1}, 1);
    TextDrawColor(Skin_Selection{1}, -1);
    TextDrawSetShadow(Skin_Selection{1}, 0);
    TextDrawSetOutline(Skin_Selection{1}, 1);
    TextDrawBackgroundColor(Skin_Selection{1}, 51);
    TextDrawFont(Skin_Selection{1}, 1);
    TextDrawSetProportional(Skin_Selection{1}, 1);
    TextDrawSetSelectable(Skin_Selection{1}, true);


    Skin_Selection{2} = TextDrawCreate(309.500000, 364.875000, ">>");
    TextDrawLetterSize(Skin_Selection{2}, 0.449999, 1.600000);
    TextDrawTextSize(Skin_Selection{2}, 331.500000, 10.0);
    TextDrawAlignment(Skin_Selection{2}, 1);
    TextDrawColor(Skin_Selection{2}, -1);
    TextDrawSetShadow(Skin_Selection{2}, 0);
    TextDrawSetOutline(Skin_Selection{2}, 1);
    TextDrawBackgroundColor(Skin_Selection{2}, 51);
    TextDrawFont(Skin_Selection{2}, 1);
    TextDrawSetSelectable(Skin_Selection{2}, true);


    Skin_Selection{3} = TextDrawCreate(353.000000, 365.000000, "SET");
    TextDrawLetterSize(Skin_Selection{3}, 0.449999, 1.600000);
    TextDrawTextSize(Skin_Selection{3}, 375.000000, 10.0);
    TextDrawAlignment(Skin_Selection{3}, 1);
    TextDrawColor(Skin_Selection{3}, -1);
    TextDrawSetShadow(Skin_Selection{3}, 0);
    TextDrawSetOutline(Skin_Selection{3}, 1);
    TextDrawBackgroundColor(Skin_Selection{3}, 51);
    TextDrawFont(Skin_Selection{3}, 1);
    TextDrawSetSelectable(Skin_Selection{3}, true);

    TextDrawShowForPlayer(playerid,Skin_Selection{0});
    TextDrawShowForPlayer(playerid,Skin_Selection{1});
    TextDrawShowForPlayer(playerid,Skin_Selection{2});
    TextDrawShowForPlayer(playerid,Skin_Selection{3});
    SelectTextDraw(playerid,0x00FF00FF);