Skip to content

Instantly share code, notes, and snippets.

/// Transforms a position from one coordinate system to another
/// This function presumes you're using GameMaker's native camera/view system and are not
/// manually setting custom view/projection matrices. Also if you're drawing your application
/// surface yourself then the coordinate transform *may* not be accurate, but it usually is.
///
/// N.B. The struct returned from this function is declared as static for the sake of efficiency.
/// If you want to store values, don't keep a reference to the struct as it is liable to change!
///
/// N.B. This function does NOT take into account view_set_xport() or view_set_yport(). I've not
/// seen someone use those functions in many years.
@tabularelf
tabularelf / function_execute.gml
Last active October 4, 2023 23:46
Executing functions or methods with an array of arguments
/// @func function_execute( function/method, [arguments_in_array])
/// @desc Executes a runtime function, GML function or method, respecting method rules.
/// @param function/method
/// @param [arguments_in_array]
function function_execute(_funcMethod, _args = undefined) {
gml_pragma("forceinline");
if (is_undefined(_args)) return _funcMethod();
var _func = _funcMethod;
var _self = self;
@JamieMason
JamieMason / html-languages.txt
Created September 19, 2012 08:50
HTML lang attribute / ISO language code reference / Culture names
CULTURE SPEC.CULTURE ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)