GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 Script Submission » Simple Debug Message Script » 2018-09-19 11:17:16

Marcus12321
Replies: 6
Expand/// dbg(arguments[]);
//
//  Prints a comma delimited show_debug_message of the variables provided.
//  
//  Nothing spectacular, just quicker than typing out show_debug_message().
//  
//  Also, it is possible to just copy and paste the portion of a function in 
//  parenthesis and put it in a dbg statement.
//
//  For example, you can take this line:
//      draw_sprite_stretched(vSprite2,1,vX+W2[0],vY, vWidth-(W2[0]+W2[2]),vSpriteH2);
//
//  And easily display it like this:
//      dbg(vSprite2,1,vX+W2[0],vY, vWidth-(W2[0]+W2[2]),vSpriteH2);
//
//  GMS2 Header:
//
/// @func dbg(arguments[])
/// @desc Prints the variables to the debug window.
/// @param {string} arguments Any number of variables.
///

var s=date_time_string(date_current_datetime()) + ": ";
var i=0;
repeat (argument_count-1) {
	s+=string(argument[i]) + ", ";
	i++;
}

s+=string(argument[i]);
show_debug_message(s);

Board footer

Powered by FluxBB