This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------------------------------------------------------------------------------------\\ | |
// __ It looks like you're looking for advice on initialization, | |
// / \ / Would you like help with that? | |
// | | | |
// @ @ Tinkerer_Red has removed all of the gml_pragma( "global", *); | |
// | | from the functions to prevent issues importing. | |
// || |/ If you would like to re-enable them just un comment them! | |
// || || | |
// |\_/| He also commented out the MacroExpansion in | |
// \___/ `__global_object_depths` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function draw_hq_text_ext_transformed(_x,_y,_str,_sep,_width,_xscale,_yscale,_angle) { | |
//this function will automatically adjust the x, y, width, scakes and sep based on what the gui was scaled to before hand | |
//this is a drawing function for breaking out of the rescaling the gui layer to the highest possible quality before returning | |
static _is_browser = (os_browser != browser_not_a_browser); | |
var _w, _h; | |
//get the gui measurements | |
if (_is_browser){ | |
_w = browser_width; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this requires camera 0 to be active in all rooms you wish to be auto scaled | |
#macro __SETTINGS_AUTO_SCALE true | |
//these settings will require Window's window resize setting to be set to true | |
#macro __SETTINGS_ALLOW_WINDOW_RESIZE_HORZ true | |
#macro __SETTINGS_ALLOW_WINDOW_RESIZE_VERT true | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#macro PROMISE_MAX_TIME (1/60 * 1_000 * 1_000) * (1/16) //the max time in milli seconds to spend on the promises, default is 1/16 of frame time of a 60 fps game | |
enum PROMISE_STATE { | |
PENDING, | |
RESOLVED, | |
REJECTED, | |
PAUSED, | |
}; | |
function __PromiseNamespace__() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//feather ignore all | |
#region jsDoc | |
/// @func collision_circle_array() | |
/// @desc This function is the same as the collision_circle() function, only instead of just detecting one instance / tile map in collision at a time, it will detect multiple instances or tile maps. | |
/// @param {Real} x1 : The x coordinate of the center of the circle to check. | |
/// @param {Real} y1 : The y coordinate of the center of the circle to check. | |
/// @param {Real} rad : The radius (distance in pixels from its center to its edge). | |
/// @param {Id.TileMapElement | Asset.GMObject | Id.Instance | Constant.All | Constant.Other | Array} obj : Asset or Object Instance or Tile Map Element ID or Array An object, instance, tile map ID, keywords all/other, or array containing these items | |
/// @param {Bool} prec : Whether the check is based on precise collisions (true, which is slower) or its bounding box in general (false, faster). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region jsDoc | |
/// @func collision_circle_array() | |
/// @desc This function is the same as the collision_circle() function, only instead of just detecting one instance / tile map in collision at a time, it will detect multiple instances or tile maps. | |
/// @param {Real} x1 : The x coordinate of the center of the circle to check. | |
/// @param {Real} y1 : The y coordinate of the center of the circle to check. | |
/// @param {Real} rad : The radius (distance in pixels from its center to its edge). | |
/// @param {Object} obj : Asset or Object Instance or Tile Map Element ID or Array An object, instance, tile map ID, keywords all/other, or array containing these items | |
/// @param {Boolean} prec : Whether the check is based on precise collisions (true, which is slower) or its bounding box in general (false, faster). | |
/// @param {Boolean} notme : Whether the calling instance, if relevant, should be excluded (true) or not (false). | |
/// @param {Array} array : The array to use to store the IDs of colliding instances |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///feather ignore all | |
function GMString(_val_or_format, _arg1=undefined, _arg2=undefined, _arg3=undefined, _arg4=undefined, _arg5=undefined, _arg6=undefined, _arg7=undefined, _arg8=undefined, _arg9=undefined, _arg10=undefined, _arg11=undefined, _arg12=undefined, _arg13=undefined, _arg14=undefined, _arg15=undefined) : __GMString__() constructor{ | |
str = string(_val_or_format, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15); | |
length = string_length(str); | |
} | |
function GMStringExt(_val_or_format, _arg_array) : __GMString__() constructor{ | |
str = string_ext(_val_or_format, _arg_array); | |
length = string_length(str); | |
} | |
function GMStringFormat(_val, _total, _dec) : __GMString__() constructor{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function string_split_by_width(_str, _line_width, _font=draw_get_font()) { | |
if (_str == undefined) return; | |
if (_line_width < 0) _line_width = 10000000; // means nothing will "wrap" | |
var _prev_font = draw_get_font(); | |
draw_set_font(_font); | |
var _whitespace = " "; | |
var _newline = chr(0x0a); // \n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#macro trace __trace(_GMFILE_+"/"+_GMFUNCTION_+":"+string(_GMLINE_)+": ") | |
function __trace(_location) { | |
static __struct = {}; | |
__struct.__location = _location; | |
return method(__struct, function(_str){ | |
show_debug_message(__location + ": " + string(_str)); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function log(_str) {return show_debug_message(_str)}; | |
function A() constructor { | |
static example = function(){ | |
log("Calling A"); | |
} | |
} | |
function B() : A() constructor { | |
static example = function() { |
NewerOlder