1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

KAG Scripts for GML

Discussion in 'Community Dev Corner' started by Asu, Sep 18, 2013.

Mods: Downburst, Mazey
  1. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    Those are not a lot of scripts for now but there will be a map rendering one, and more. I'll make a map editor with those scripts. It will be open-source.

    Those scripts are commented. It is very easy to understand and to modify the script.

    Language : GameMaker Language ( GML )

    draw_framedstone(x,y,w,h);
    Code:
    /* Color variables. Modify RGB values if you want other colors. */
    color_ext = make_color_rgb(19, 13, 29);
    color_vertical = make_color_rgb(132, 71, 21);
    color_horizontal = make_color_rgb(159, 97, 37);
    color_fill = make_color_rgb(66, 72, 75);
    
    /* Position variables. DO NOT MODIFY. Used for cleaner script */
    posx = argument0;
    posy = argument1;
    posx2 = posx + argument2;
    posy2 = posy + argument3;
    
    /* Rectangles */
    draw_rectangle_color(posx-3, posy-3, posx2+3, posy2+3, color_ext, color_ext, color_ext, color_ext, true); // External rectangle
    draw_rectangle_color(posx-1, posy-1, posx2+1, posy2+1, color_ext, color_ext, color_ext, color_ext, true); // Internal rectangle
    draw_rectangle_color(posx, posy, posx2, posy2, color_fill, color_fill, color_fill, color_fill, false);    // Filling rectangle
    
    /* Horizontal */
    draw_line_color(posx-2, posy-2, posx2+3, posy-2, color_horizontal, color_horizontal);                     // Left
    draw_line_color(posx-2, posy2+2, posx2+3, posy2+2, color_horizontal, color_horizontal);                   // Right
    
    /* Vertical */
    draw_line_color(posx-2,posy-1,posx-2,posy2+2, color_vertical, color_vertical);                            // Left
    draw_line_color(posx2+2,posy-1,posx2+2,posy2+2, color_vertical, color_vertical);                          // Right

    PROS :
    - No sprite needed
    - Fast
    - Easy to modify
    - Should be gm7, gm8 and gms compatible. Maybe lite versions should work too.

    CONS :
    - Only 1x
     
  2. Ardivaba

    Ardivaba Bison Rider Tester
    1. The Young Blood Collective - [YB]

    Messages:
    56
    What in the fuq is this? What am i missing?
     
  3. Powse

    Powse Bison Rider

    Messages:
    37
    It's a few functions you can put in gamemaker if you own it. By looking at it it I'm assuming it makes colored squares...
     
  4. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    There will be more functions in, maybe about API etc.
     
Mods: Downburst, Mazey