Skip to content

Instantly share code, notes, and snippets.

View gnysek's full-sized avatar
💭
Kuwabara! Kuwabara!

gnysek gnysek

💭
Kuwabara! Kuwabara!
View GitHub Profile
@gnysek
gnysek / fnames.gml
Created December 19, 2022 08:43
fnames-2023.100.0.264
//////////////
// Chapter 401
//////////////
// # = constant
// * = readonly
// @ = instance variable
// & = obsolete
// $ = US spelling
// £ = UK spelling
@gnysek
gnysek / singleton.gml
Created February 13, 2023 21:20
Singleton test
function Test() constructor {
static test = "--- singleton test";
}
Test();
function get_test() {
return static_get(Test);
}
@gnysek
gnysek / buffedecrypt.gml
Created August 6, 2023 22:51
buffedecrypt.gml
// 39dll <3
function bufferencrypt(_key, b = global.buffer) {
bufferdecrypt(_key, b);
}
function bufferdecrypt(_key, _buff = global.buffer) {
var keylen = min(string_length(_key), 256);
if (keylen < 0) return false;
@gnysek
gnysek / draw.gml
Created October 13, 2023 16:30
rectangle clip/cut
clip_x1 = 10;
clip_x2 = 500;
clip_y1 = 10;
clip_y2 = 100;
draw_set_color(c_white);
draw_set_alpha(1);
// set up shader:
shader_set(shd_clip_rect);
@gnysek
gnysek / foreach.gml
Last active February 20, 2024 14:18
Foreach GML
/// @return N/A (0)
///
/// Executes a method call for each element of the given struct/array/data structure.
/// This iterator is shallow and will not also iterate over nested structs/arrays (though
/// you can of course call foreach() inside the specified method)
///
/// This function can also iterate over all members of a ds_map, ds_list, or ds_grid.
/// You will need to specify a value for [dsType] to iterate over a data structure
///
/// The specified method is passed the following parameters:
//////////////
// Chapter 401
//////////////
// # = constant
// * = readonly
// @ = instance variable
// & = obsolete
// $ = US spelling
// £ = UK spelling