Skip to content

Instantly share code, notes, and snippets.

View JujuAdams's full-sized avatar
🌈

Juju Adams JujuAdams

🌈
View GitHub Profile
Beta IDE v2024.400.0.532 Beta Runtime v2024.400.0.551
I. Android, iOS
1. Open either A or B
2. Wait for playback to begin
3. Observe that the "video_start" event occurs
4. Click "Close"
5. Wait for playback to finish
6. Observe that the "video_end" event does not occur
Expected: "video_end" event occurs when playback finishes in any situation, including via video_close()
/// 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.
@JujuAdams
JujuAdams / resLib.gml
Created December 11, 2022 14:07
GML Resolution Library
enum RES_LIB
{
//Desktop and console
DESKTOP_720P,
DESKTOP_1366_X_768,
DESKTOP_1080P,
DESKTOP_1440P,
DESKTOP_4K,
//Android Phones
@JujuAdams
JujuAdams / gist:4b0f8839335df48f520c63f5ef58dc8e
Last active November 14, 2023 21:37
A brief introduction to batch breaks in GameMaker
"Do you have any resources or info you can throw my way so I can better understand what does and doesn't break a batch?"
1. changing shader and/or setting uniforms
2. changing texture page (handled internally in GM. implicitly changing texture group also causes a batch break, and this too is handled by GM internally)
3. changing surface target
4. some primitives sometimes (though that may have changed now)
5. drawing tilemaps
6. draw_clear()
7. changing blend mode
8. changing matrices
//// quick n dirty script to get gms2-mapped pad device type across pc/android
//
// takes gamepad id (real), returns device type (string)
// types: xb360, xbone, ps3, ps4, switch, snes, saturn, 8bitdo, steam, ouya
// note: xb360 & xbone are conflated on windows target
//
// refs:
// https://github.com/gabomdq/SDL_GameControllerDB/
// https://yachtclubgames.com/2014/03/steam-controller-support/
// https://github.com/libretro/retroarch-joypad-autoconfig/