Jump to content


thecrazygamemaster

Member Since 26 Aug 2008
Offline Last Active Yesterday, 08:35 PM

Topics I've Started

Percentage Success

17 June 2013 - 07:25 AM

-Solved without use of this topic, please delete-


[V0.1] Tcgm'S Classgui Engine

21 April 2013 - 07:05 AM

  • Title: ClassGUI Engine
  • Description: This project takes inspiration from the
    way HTML and CSS handle classtypes, declaring classes in CSS and interpreting them in the HTML.
    It is extremely powerful, and very customizable. I believe that any GUI object type can be created inside this engine.
    And the best part about this engine? It's response time is not limited by game speed, because everything is executed in the draw event!
  • GM Version: :GMS: :GM81:
  • Registered: I believe it does, but I may be wrong.
  • File Type: .gmz and .gm81 (in zip file), GM:S project folder also included.
  • File Size: 6.14mb
  • File Link: https://dl.dropboxus...assGUI v0.1.zip
  • Required Extensions: N/A
  • Required DLLs: N/A
  • Tags: Meh, later.
  • Summary
    From the readme:
    /*
    
    Hello, and welcome to my ClassGUI system! This project takes inspiration from the 
    way HTML and CSS handle classtypes, declaring classes in CSS and interpreting them in the HTML. 
    
    It is extremely powerful, and very customizable. I believe that any GUI object type can be created inside this engine.
    And the best part about this engine? It's response time is not limited by game speed, because everything is executed in the draw event!
    
    In this case, the interactivity and drawing sections handle how classes work, and the declaration section
    is essentially the CSS. I'm sure, given enough time, someone could come up with a legitimate HTML interpeter 
    for GM,but that person is not me. I likely won't even try. Either way, this gui system is much easier than using
    a hundred different objects, or different scripts for every gui object.
    
    While there is nothing but a singular classtype and the supporting code for the engine in this project, I may add more in the future.
    Either way, if you know anything about coding, you will be able to make classtypes yourself. I am always available by pm on the GMC.
    
    The code is heavily commented, and each section says what it does. Given the time it took for me to nail this
    system down to a science, I highly doubt anyone will understand the code right off the bat; regardless, stick to
    it, and you will eventually understand. May your games be fun and powerful.
    
    Kudos,
    TCGM
    
    P.S. Please give me credit for the system if you use it. I'll be happy! :D
    */
    

 

Changelog:

 

v0.3:
(In Development)
-Fixes several glaring errors
-Adds dynamic healthbars
-Removes button text scaling and replaces it with font size switching

v0.1:
-Release

 

.


How The Hell Do You Use Gms Surfaces?

22 March 2013 - 02:48 PM

I've looked up tons of effects for a project I'm doing; they've all used surfaces in GM8.1. Now, I can understand how they do what they do, even modify them to do what I want, but I can't for the life of me port them to GMS. I just don't have a clear understanding of how surfaces in GMS work. Don't link me the yoyogames wiki page, I read that already. And look how useful it's been.

 

percent1.jpg


Geodesic Sphere Texture Problem

17 March 2013 - 05:47 PM

The geodesic sphere code I am using is TheSnidr's, found here: http://gmc.yoyogames...howtopic=512811

I have a 256x256 texture I wish to apply to this sphere. I have a d3d_draw_ellipsoid sphere in the center of this image, which the texture applies fine to. The overlayed, semi-transparent sphere is the geodesic. As you can see, the texture decided to stretch across half of it.

Posted Image

I'm clueless as to why this is occurring. If anyone could point out what I am doing wrong, it would be greatly appreciated. Note that I am using the IDENTICAL draw code to TheSnidr's example.

Drawing Gui Elements (Solved)

15 February 2013 - 11:59 PM

Right, so. I wrote this ridiculously complicated pair of scripts; one that initializes all the Menu GUI elements, and then one that not only draws, but provides all the functions for them. My problem is that only one UI element will show on the options menu, and it is driving me crazy. I can't figure out why; the code should be drawing absolutely ALL the elements, but nope. Anyone with the patience to look through this, please point out my error, because I can see none.

Oh, and whenever I also include anything above 4 elements to be sent to the menu_navigation script, the game instantly freezes, no response. So if anyone can tell me why that is happening, I'll give you a cookie.

menu_elements_init():

element_num=10;
global.menu_elements=ds_grid_create(element_num,11);

/*
emname=ds_grid_get(global.menu_elements,i,0);
emxx=ds_grid_get(global.menu_elements,i,1);
emyy=ds_grid_get(global.menu_elements,i,2);
emw=ds_grid_get(global.menu_elements,i,3);
emh=ds_grid_get(global.menu_elements,i,4);
emaction=ds_grid_get(global.menu_elements,i,5);
emvalue=ds_grid_get(global.menu_elements,i,6);
emfont=ds_grid_get(global.menu_elements,i,7);
emtcolor=ds_grid_get(global.menu_elements,i,8);
emcolor=ds_grid_get(global.menu_elements,i,9);
emzone=ds_grid_get(global.menu_elements,i,10);
*/

for(i=0;i<ds_grid_width(global.menu_elements);i++)
{
    var emname,emxx,emyy,emw,emh,emaction,emvalue,emfont,emtcolor,emcolor,emzone;
    switch i
    {
        case 0:
            emname="Begin"
            emxx=global.display_width/2;
            emyy=global.display_height/2+300;
            emw=200;
            emh=30;
            emaction="change_screens";
            emvalue="main";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="intro";
        break;
        case 1:
            emname="Options"
            emxx=global.display_width/2+300;
            emyy=global.display_height/2;
            emw=200;
            emh=30;
            emaction="change_screens";
            emvalue="options";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="main";
        break;
        case 2:
            emname="Back"
            emxx=global.display_width/2-300;
            emyy=global.display_height/2;
            emw=200;
            emh=30;
            emaction="change_screens";
            emvalue="main";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
        case 3:
            emname="Fullscreen"
            emxx=global.display_width/2+300;
            emyy=global.display_height/2;
            emw=200;
            emh=30;
            emaction="toggle_fullscreen";
            emvalue="main";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
        case 4:
            emname="Antialiasing"
            emxx=global.display_width/2;
            emyy=160;
            emw=200;
            emh=30;
            emaction="null";
            emvalue="null";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
        case 5:
            emname="2 times"
            emxx=global.display_width/2;
            emyy=200;
            emw=200;
            emh=30;
            emaction="change_aa";
            emvalue="2";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
        case 6:
            emname="4x"
            emxx=global.display_width/2-400;
            emyy=200;
            emw=200;
            emh=30;
            emaction="change_aa";
            emvalue="4";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
        case 7:
            emname="8x"
            emxx=global.display_width/2-200;
            emyy=200;
            emw=200;
            emh=30;
            emaction="change_aa";
            emvalue="8";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
        case 8:
            emname="12x"
            emxx=global.display_width/2;
            emyy=200;
            emw=200;
            emh=30;
            emaction="change_aa";
            emvalue="12";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
        case 9:
            emname="16x"
            emxx=global.display_width/2+200;
            emyy=200;
            emw=200;
            emh=30;
            emaction="change_aa";
            emvalue="16";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
        case 9:
            emname="Vsync"
            emxx=global.display_width/2;
            emyy=240;
            emw=200;
            emh=30;
            emaction="toggle_vsync";
            emvalue="";
            emfont=fnt_gui_12;
            emtcolor=c_aqua;
            emcolor=c_blue;
            emzone="options";
        break;
    }
    ds_grid_set(global.menu_elements,i,0,emname);
    ds_grid_set(global.menu_elements,i,1,emxx);
    ds_grid_set(global.menu_elements,i,2,emyy);
    ds_grid_set(global.menu_elements,i,3,emw);
    ds_grid_set(global.menu_elements,i,4,emh);
    ds_grid_set(global.menu_elements,i,5,emaction);
    ds_grid_set(global.menu_elements,i,6,emvalue);
    ds_grid_set(global.menu_elements,i,7,emfont);
    ds_grid_set(global.menu_elements,i,8,emtcolor);
    ds_grid_set(global.menu_elements,i,9,emcolor);
    ds_grid_set(global.menu_elements,i,10,emzone);
}

menu_navigate(); (the one that draws and navigates the UI)
for(i=0;i<ds_grid_width(global.menu_elements);i++)
{
    var emname,emxx,emyy,emw,emh,emaction,emvalue,emfont,emtcolor,emcolor,emzone;
    emname=ds_grid_get(global.menu_elements,i,0);
    emxx=ds_grid_get(global.menu_elements,i,1);
    emyy=ds_grid_get(global.menu_elements,i,2);
    emw=ds_grid_get(global.menu_elements,i,3);
    emh=ds_grid_get(global.menu_elements,i,4);
    emaction=ds_grid_get(global.menu_elements,i,5);
    emvalue=ds_grid_get(global.menu_elements,i,6);
    emfont=ds_grid_get(global.menu_elements,i,7);
    emtcolor=ds_grid_get(global.menu_elements,i,8);
    emcolor=ds_grid_get(global.menu_elements,i,9);
    emzone=ds_grid_get(global.menu_elements,i,10);
    if emzone=global.scrn
    {
        /*Usage:
        draw_gui_background(titletext,font,fontcolor,anchorx,anchory,width,height,titleborder,color,alpha,shadowiterations)
        */
        draw_gui_background(string(emname),emfont,emtcolor,emxx,emyy,emw,emh,emh/3,emcolor,0.7,3);
        switch emaction
        {
            case "change_screens":
                if gui_mouse_get_clicked(emxx,emyy,emw,emh,mb_left)=true
                {
                    global.scrn=emvalue;
                }
            break;
            case "start_game":
                if gui_mouse_get_clicked(emxx,emyy,emw,emh,mb_left)=true
                {
                    room_goto(room_main);
                }
            break;
           case "toggle_fullscreen":
                if gui_mouse_get_clicked(emxx,emyy,emw,emh,mb_left)=true
                {
                    if window_get_fullscreen()=true
                    window_set_fullscreen(false);
                    else
                    window_set_fullscreen(true);
                }
            break;
            case "toggle_vsync":
                if gui_mouse_get_clicked(emxx,emyy,emw,emh,mb_left)=true
                {
                    if global.vsync=true
                    global.vsync=false;
                    else
                    global.vsync=true;
                }
            break;
            case "change_aa":
                if gui_mouse_get_clicked(emxx,emyy,emw,emh,mb_left)=true
                {
                    var aa;
                    aa=real(emvalue);
                    display_reset(aa,global.vsync);
                }
            break;
        }
    }
}