GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2007-08-19 04:59:18

xot
Administrator
Registered: 2007-08-18
Posts: 1,240

Code Highlighting

These forums feature experimental code highlighting. The feature is turned off by default. You can enable it in your Profile > Display settings. There are two levels of operation. Full highlighting will render code just like the Game Maker editor does along with highlighting numbers and quoted strings. Basic mode only highlights quoted strings, numbers, comments, and keywords and renders much faster. On some browsers full highlighting can be rather slow.

Known browser issues:
Firefox - slow rendering
Internet Explorer 6 - infamous IE peekaboo bug sometimes hides bits of code
Opera - none


Abusing forum power since 1986.

Offline

#2 2007-10-14 19:03:57

xot
Administrator
Registered: 2007-08-18
Posts: 1,240

Re: Code Highlighting

OK, new information. I have decided to get rid of the experimental temperamental code highlighting. It had a couple of cool features, but it had way too many bugs and drawbacks. So it has been replaced with the same server-side highlighting that is on GMLscripts.com. That system, GML Beautifier, which I originally got from Rithiur, has proved itself to be quite robust. I've recently made some changes to it to reduce server load and I think it is going to work well with the forum. Since there are no client-side hassles, code highlighting is now enabled by default. If the code below does not appear to be highlighted, refresh your browser to update your cached CSS files. Enjoy!

Expand/*
**  Usage:
**      inst = instance_nth_nearest(x,y,obj,n);
**
**  Arguments:
**      x,y       a point
**      obj       an object_index, or keyword "all"
**      n         proximity
*/
{
    var pointx,pointy,object,n,list,nearest;
    pointx = argument0;
    pointy = argument1;
    object = argument2;
    n = argument3;
    n = min(max(1,n),instance_number(object));
    list = ds_priority_create();
    nearest = noone;
    with (object) ds_priority_add(list,id,distance_to_point(pointx,pointy));
    repeat (n) nearest = ds_priority_delete_min(list);
    ds_priority_destroy(list);
    return nearest;
}

Abusing forum power since 1986.

Offline

#3 2007-10-20 16:25:47

IamCalle
Member
Registered: 2007-10-20
Posts: 23

Re: Code Highlighting

Code highlighting. smile
I was hoping to see this. ^^

Offline

Board footer

Powered by FluxBB