SA-MP Forums Archive
[Sneak Peek] Graphics User Interface For SA-MP (using Textdraws) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: [Sneak Peek] Graphics User Interface For SA-MP (using Textdraws) (/showthread.php?tid=328410)



[Sneak Peek] Graphics User Interface For SA-MP (using Textdraws) - iPLEOMAX - 24.03.2012

Hello guys, I'll show you a little bit of my upcoming release.
Thanks to the Clickable Textdraws by SA-MP Team!

The GUI System is made of three Main parts: This code:
pawn Код:
DESIGN(numericupdown)
    @COLOR(0xFFFFFF22)
    @BGCOLOR(0x00000066)
    @FONTCOLOR(0xFFFFFFFF)
DESIGNe

DESIGN(window)
    @COLOR(0x00E03422)
    @BGCOLOR(0x00000066)
    @FONTCOLOR(0xFFFFFFFF)
    @SIZE(320, 190)
    @LOCATION(160, 200)
DESIGNe

DESIGN(button)
    @BGCOLOR(0x444444AA)
DESIGNe

new ControlPanel;

public OnFilterScriptInit()
{
    ControlPanel =
    CreateWindow(window, "Filthy & Dirty Privillages");
   
    CreateNumericUpDown(ControlPanel, numericupdown, "numeric_weather", 0, 0, 1, 100, 170, 220);
    CreateButton(ControlPanel, button, "Set Weather", "setweather", 170, 240, 100, 23);
   
    CreateNumericUpDown(ControlPanel, numericupdown, "numeric_time", 0, 0, 1, 23, 170, 275);
    CreateButton(ControlPanel, button, "Set Time", "settime", 170, 295, 100, 23);
   
    CreateNumericUpDown(ControlPanel, numericupdown, "numeric_car", 400, 400, 1, 611, 170, 325);
    CreateButton(ControlPanel, button, "Spawn Car", "spawncar", 170, 345, 100, 23);
   
    CreateNumericUpDown(ControlPanel, numericupdown, "numeric_money", 0, -10000, 500, 10000, 290, 220);
    CreateButton(ControlPanel, button, "Give Money", "givemoney", 290, 240, 100, 23);
   
    CreateNumericUpDown(ControlPanel, numericupdown, "numeric_score", 0, -1000, 50, 1000, 290, 275);
    CreateButton(ControlPanel, button, "Give Score", "givescore", 290, 295, 100, 23);
   
    return true;
}

public OnPlayerClickButton(playerid, Event[])
{
    if(!strcmp(Event, "setweather"))
    return SetWeather(GetNumericValue(playerid, "numeric_weather"));
   
    if(!strcmp(Event, "settime"))
    return SetWorldTime(GetNumericValue(playerid, "numeric_time"));
   
    if(!strcmp(Event, "spawncar"))
    {
        if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You already have a car!");
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        new VID = CreateVehicle(GetNumericValue(playerid, "numeric_car"), X, Y, Z, 0, -1, -1, 0);
        PutPlayerInVehicle(playerid, VID, 0);
        return true;
    }
   
    if(!strcmp(Event, "givemoney"))
    return GivePlayerMoney(playerid, GetNumericValue(playerid, "numeric_money"));
   
    if(!strcmp(Event, "givescore"))
    return SetPlayerScore(playerid, GetPlayerScore(playerid) + GetNumericValue(playerid, "numeric_score"));
   
    return true;
}
Does this:
[ame]http://www.youtube.com/watch?v=iWKkRTb-C-I[/ame]

Features:
Designing the Elements are made easy, some examples:

pawn Код:
DESIGN
    @COLOR()
    @BGCOLOR()
    @BGIMAGE()
    @FONT()
    @FONTOUTLINE()
    @FONTCOLOR()
    @FONTSHADOW()
    @FONTSIZEX()
    @FONTSIZEY()
    @FONTSIZE(x,y)
    @SIZE(x,y)
    @HEIGHT()
    @WIDTH()
    @LOCATION(x,y)
    @LOCATIONX()
    @LOCATIONY()
DESIGNc

//and more to come....
To-do: Tell me how is it and what you would like to see in it!


Re: [Sneak Peek] Graphics User Interface For SA-MP (using Textdraws) - Steven82 - 24.03.2012

Looks pretty useful. Great work, can't wait for the release!


Re: [Sneak Peek] Graphics User Interface For SA-MP (using Textdraws) - Krx17 - 24.03.2012

It actually looks really good. I'm looking forward to use this if and when you release it. Although you should've posted this in the Screenshots section. Very good work.


Re: [Sneak Peek] Graphics User Interface For SA-MP (using Textdraws) - T0pAz - 24.03.2012

Ofcourse.


Re: [Sneak Peek] Graphics User Interface For SA-MP (using Textdraws) - lordturhan - 24.03.2012

So awesome!


Re: [Sneak Peek] Graphics User Interface For SA-MP (using Textdraws) - Hiddos - 24.03.2012

The clickable textdraw thingy is great, I'm pretty sure it'll let people experience SA-MP the way they never did before. Good luck on the project, I'll try to make some of my own ideas as well