[Include] Graphic Functions! v.0.1A
#1

graphfunc v.0.1A

__________________________________________________


Introduction:
Very simple include, where you can easily add some nice graphs (as textdraws) to your server.
While I'm going to write this topic, I'll also be using some parts of a graph example code.

Functions:
pawn Код:
-
    native Graph:GRAPHIC::Create(Float:x, Float:y, Float:x_min, Float:y_min, Float:x_max, Float:y_max);
    native GRAPHIC::XYAxisColor(Graph:_id, _x_color, _y_color);
    native GRAPHIC::UseBackground(Graph:_id, use);
    native GRAPHIC::BackgroundColor(Graph:_id, color);
    native GRAPHIC::GRAPHIC::AddPoint(Graph:_id, Float:x, Float:y, color);
    native GRAPHIC::ShowForPlayer(playerid, Graph:_id);
    native GRAPHIC::HideForPlayer(playerid, Graph:_id);
    native GRAPHIC::ShowForAll(Graph:_id);
    native GRAPHIC::HideForAll(Graph:_id);
    native GRAPHIC::Update(Graph:_id, playerid = INVALID_PLAYER_ID);
    native GRAPHIC::Destroy(Graph:_id);
    native GRAPHIC::OtherXYAxis(oper, playerid, Graph:_id, xAxis, yAxis);
Callbacks:
forward GRAPHIC::Init()

This callback should be use to create each graph, for example:
pawn Код:
new
        Graph:MY_GRAPH;

    public
        GRAPHIC::Init()
    {
        MY_GRAPH = GRAPHIC::Create(200.0, 250.0, -50, -50, 50, 50);
        GRAPHIC::XYAxisColor(MY_GRAPH, 0xFFFFFF55, 0xFFFFFF55);

        GRAPHIC::UseBackground(MY_GRAPH, 1);
        GRAPHIC::BackgroundColor(MY_GRAPH, 0x00000033);

        GRAPHIC::AddPoint(MY_GRAPH, 50,  50, 0x25478588);

        // other graphic creations..               

        return 1;
    }
Restrictions:
There are some sense restrictions when creating a graphic. (at least with this script)
You'll NOT be able to create graphs in this terms:
  • x-Min, y-Min, x-Max and y-Max all equal to 0
  • x-Min and x-Max both equal to 0
  • y-Min and y-Max both equal to 0
Example with screenshot:
Screenshot here!
Pastebin code here!

Download:
Want to download it? Click here! THANKS TO KAR!!

Request:
When replying in order to report a bug, please keep the following form structure: (including the bbcode: code)
Код:
» bug report:
  • Information here..
_script_version, 0x01A.

- © PLAYMAKER 2011
Reply
#2

So this is boxes, lines, triangles, dots and etc.

Good job, 10/10
Reply
#3

This is absolutely amazing. Nicely done, pmkrz!
Reply
#4

Amazing, good job and thanks for sharing.
Reply
#5

Thanks a lot, people! ( :

btw.. you can also hide/show the x and y axis with GRAPHIC::OtherXYAxis. Read the documentation inside the source.
Reply
#6

I had this idea a while ago, but didn't start yet; but not need for that. Nice work.
Reply
#7

So it only creates Graphs? I can't think of a very valid way to use this, but it's nice looking.
Reply
#8

Thats, awesome im thinking of using this for something great coming up, thanks man, much appreciated for the release.
Reply
#9

Thanks again! ; D
Reply
#10

Nice work
Reply
#11

Can you post some screens of Graphics, anyway i love this
Reply
#12

^Did you read the topic ? : s
Reply
#13

Screenshots ?

Cant imagine it...
Reply
#14

You are genius
Reply
#15

@Swiftz, Trooper[Y]:

Did you read the topic ? <2>

Quote:
Originally Posted by pmkrz
Посмотреть сообщение
Example with screenshot:
Screenshot here!
Pastebin code here!
Thanks to the others! ( :
Reply
#16

wow, nice work indeed.
Reply
#17

Thanks, Donya!
Reply
#18

can you post an example of a Triangle?
Reply
#19

You just need to add points where they need to be (all close to give an idea of lines). Then if you want, hide the background (if enable) and the x/y axis (just to show the triangle)..
But still if you need my help, maybe tomorrow I'll do that, today I'm too busy. _sorry. : (
Reply
#20

It would be hard to make a smooth circle?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)