Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7f95ecf
big overhaul
stann-co Sep 1, 2025
7439c8e
indentation cleanup
stann-co Sep 1, 2025
522a0b8
Fix spacing
bfrymire Sep 15, 2025
f2908ac
Remove duplicate function
bfrymire Sep 15, 2025
a2673b8
Convert constructor functions into static functions
bfrymire Sep 15, 2025
5a737e0
Fix local variable names
bfrymire Sep 15, 2025
01b79ac
Fix indentation style to tabs
bfrymire Sep 16, 2025
d93d8ef
Update readme.md
bfrymire Sep 16, 2025
6b511f5
zone transitions
stann-co Oct 14, 2025
8249f02
Merge branch 'big-overhaul-2.4' of https://github.com/stann-co/STANNc…
stann-co Oct 14, 2025
9e74839
Revert "Merge branch 'big-overhaul-2.4' of https://github.com/stann-c…
stann-co Oct 16, 2025
8d355c3
zone constraint optimization
stann-co Oct 17, 2025
520d5ad
fix tv, and window mode switching
stann-co Oct 19, 2025
a386225
fixed most remaining issues
stann-co Oct 21, 2025
22abf0e
font
stann-co Oct 21, 2025
f8c8aed
tiny fixes
stann-co Oct 21, 2025
0b4d28f
camera offsets constrains to zones
stann-co Oct 22, 2025
ec51701
yy files
stann-co Nov 12, 2025
af36928
added __gui_x_scale as a saved variable
stann-co Nov 13, 2025
9f39817
Fix spacing
bfrymire Jan 6, 2026
765493a
Convert back to dividing by 2
bfrymire Jan 6, 2026
71dddaa
Fix memory leak in zone constrain
bfrymire Jan 7, 2026
4047b96
Remove non-existing variable
bfrymire Jan 7, 2026
86ec31c
Update timing to evaluate first, then increase time
bfrymire Jan 7, 2026
70c8a69
Update .gitignore
bfrymire Jan 7, 2026
76cc924
Change zone object variable definition to expression
bfrymire Jan 7, 2026
a747a7a
Destroy array item if it's a DS list before shifting the array
bfrymire Jan 25, 2026
e7fb927
simplified camera follow speed
stann-co Feb 16, 2026
aa6143d
view_to_room room_to_view functions not internal
stann-co Feb 16, 2026
a6397ce
remove @ignore from public stanncam functions
stann-co Feb 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions objects/__obj_stanncam_manager/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ resolution_w = 0;
resolution_h = 0;
number_of_cams = 0;
keep_aspect_ratio = true;
gui_keep_aspect_ratio = true;

resize_width = 0;
resize_height = 0;

__display_scale_x = 1;
__display_scale_y = 1;
draw_zones = false;

__gui_res_w = 1;
__gui_res_h = 1;
8 changes: 4 additions & 4 deletions objects/__obj_stanncam_manager/__obj_stanncam_manager.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion objects/obj_ball/obj_ball.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions objects/obj_camera/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//camera
stanncam_init(320, 180, 1920, 1080);
stanncam_init(320, 180, 1280, 720, 640, 360);
cam1 = new stanncam(obj_player.x, obj_player.y, global.game_w, global.game_h, 0, 0);
cam1.follow = obj_player;

cam1.bounds_w = 0;
cam1.bounds_h = 0;

cam2 = undefined;

split_screen = false;
Expand All @@ -19,7 +22,8 @@ speed_mode = 1;

game_res = 2;
gui_hires = false;
gui_res = 0;
gui_res = 1;
gui_hires_scale = 6; //how much bigger the hires font is than the pixel one

resolutions = [
{w:400, h:400}, //1:1
Expand All @@ -30,3 +34,11 @@ resolutions = [
{w:1920, h:1080},
{w:2560, h:1440}
];

gui_resolutions = [
{w:320, h:180}, //16:9
{w:640, h:360},
{w:1280, h:720}
];

stanncam_debug_set_draw_zones(true);
3 changes: 3 additions & 0 deletions objects/obj_camera/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var _x = cam1.get_mouse_x();
var _y = cam1.get_mouse_y();
draw_circle(_x, _y, 10, true);
6 changes: 6 additions & 0 deletions objects/obj_camera/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,9 @@ if(pointer){
draw_sprite_ext(spr_arrow_small, 0, _arrow_x, _arrow_y, 1, 1, 180, -1, 1);
}
}

var _x = cam1.get_mouse_x();
var _y = cam1.get_mouse_y();
draw_set_color(c_red);
draw_circle(cam1.room_to_gui_x(_x), cam1.room_to_gui_y(_y), 15, true);
draw_set_color(c_white);
6 changes: 6 additions & 0 deletions objects/obj_camera/Draw_77.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ cam1.draw(0, 0);
if(split_screen){
cam2.draw(global.game_w * 0.5, 0);
}

var _x = cam1.get_mouse_x();
var _y = cam1.get_mouse_y();
draw_set_color(c_green);
draw_circle(cam1.room_to_display_x(_x), cam1.room_to_display_y(_y), 18, false);
draw_set_color(c_white);
4 changes: 2 additions & 2 deletions objects/obj_camera/Mouse_60.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var _zoom_amount = cam1.zoom_amount;
_zoom_amount -= 0.05;
_zoom_amount -= 0.01;
_zoom_amount = clamp(_zoom_amount, 0.1, 2);
cam1.zoom(_zoom_amount, 0);
cam1.zoom(_zoom_amount, 0);
2 changes: 1 addition & 1 deletion objects/obj_camera/Mouse_61.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var _zoom_amount = cam1.zoom_amount;
_zoom_amount += 0.05;
_zoom_amount += 0.01;
_zoom_amount = clamp(_zoom_amount, 0.1, 2);
cam1.zoom(_zoom_amount, 0);
39 changes: 23 additions & 16 deletions objects/obj_camera/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ if(keyboard_check_pressed(vk_f5)){
}
}

//toggle hires gui
if(keyboard_check_pressed(vk_alt)){
gui_hires = !gui_hires;
if(gui_hires){
stanncam_set_gui_resolution(1920, 1080);
} else {
stanncam_set_gui_resolution(global.game_w, global.game_h);
}
}

//moves camera to mouse press location
if(mouse_check_button_pressed(mb_left)){
var _x = cam1.get_mouse_x();
Expand All @@ -40,8 +30,8 @@ if(mouse_check_button_pressed(mb_left)){
cam1.move(_x, _y, GAME_SPEED * 1);
alarm[0] = GAME_SPEED * 1.1;
pointer = true;
pointer_x = cam1.get_mouse_x();
pointer_y = cam1.get_mouse_y();
pointer_x = _x;
pointer_y = _y;
}

//toggle zoom in
Expand Down Expand Up @@ -126,10 +116,27 @@ if(keyboard_check_pressed(vk_f1))
//switch gui resolutions
if(keyboard_check_pressed(vk_f2)){
gui_res++
if(gui_res > 6) gui_res = 0;
var _gui_w = resolutions[gui_res].w;
var _gui_h = resolutions[gui_res].h;
stanncam_set_gui_resolution(_gui_w, _gui_h);
if(gui_res >= array_length(gui_resolutions)) gui_res = 0;
var _gui_w = gui_resolutions[gui_res].w;
var _gui_h = gui_resolutions[gui_res].h;
if(gui_hires){
stanncam_set_gui_resolution(_gui_w * gui_hires_scale, _gui_h * gui_hires_scale);
} else {
stanncam_set_gui_resolution(_gui_w, _gui_h);
}
}

//toggle hires gui
if(keyboard_check_pressed(vk_alt)){
gui_hires = !gui_hires;

var _gui_w = gui_resolutions[gui_res].w;
var _gui_h = gui_resolutions[gui_res].h;
if(gui_hires){
stanncam_set_gui_resolution(_gui_w * gui_hires_scale, _gui_h * gui_hires_scale);
} else {
stanncam_set_gui_resolution(_gui_w, _gui_h);
}
}

//toggle keep aspect ratio
Expand Down
15 changes: 8 additions & 7 deletions objects/obj_camera/obj_camera.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions objects/obj_camera_pixel_grid/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ zoom_mode = 0;
zoom_text = cam1.zoom_amount

game_res = 0;

resolutions = [
{w:400, h:400}, //1:1
{w:500, h:250}, //2:1
Expand Down
6 changes: 6 additions & 0 deletions objects/obj_camera_pixel_grid/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var _dx = cam1.get_mouse_x();
var _dy = cam1.get_mouse_y();

draw_set_color(c_red);
draw_point(_dx, _dy);
draw_set_color(c_white);
20 changes: 15 additions & 5 deletions objects/obj_camera_pixel_grid/Draw_64.gml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
//draw circle over cursor pos

var _dx = cam1.get_mouse_x();
var _dy = cam1.get_mouse_y();
var _size = 10;

_dx = cam1.room_to_gui_x(_dx);
_dy = cam1.room_to_gui_y(_dy);

draw_line(_dx - _size, _dy, _dx + _size, _dy);
draw_line(_dx, _dy - _size, _dx, _dy + _size);

var _outline_width = 1;
var _precision = 8;
var _offset = 10;
Expand Down Expand Up @@ -37,9 +49,7 @@ switch (global.window_mode) {

draw_text_outline(global.gui_w - 1, _offset * 3, "window mode: " + _window_mode_text + " [F4]", _outline_width, _precision);

var mx = cam1.room_to_gui_x(cam1.get_mouse_x());
var my = cam1.room_to_gui_y(cam1.get_mouse_y());
var _mx = cam1.room_to_gui_x(cam1.get_mouse_x());
var _my = cam1.room_to_gui_y(cam1.get_mouse_y());
draw_set_halign(fa_left);
draw_text(mx, my, $"{mx} {my}");


draw_text(_mx, _my, $"{_mx} {_my}");
6 changes: 5 additions & 1 deletion objects/obj_camera_pixel_grid/Draw_77.gml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
cam1.draw(0, 0);
cam1.draw(0, 0);

var _dx = cam1.room_to_display_x(cam1.get_mouse_x());
var _dy = cam1.room_to_display_y(cam1.get_mouse_y());
draw_circle(_dx, _dy, 10, false);
4 changes: 2 additions & 2 deletions objects/obj_camera_pixel_grid/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ if(keyboard_check_pressed(vk_f4)){
var _hinput = keyboard_check(vk_right) - keyboard_check(vk_left);
var _vinput = keyboard_check(vk_down) - keyboard_check(vk_up);

if(_hinput != 0) hspd += _hinput*acceleration_spd;
if(_hinput != 0) hspd += _hinput * acceleration_spd;
else hspd -= min(abs(hspd), deacceleration_spd) * sign(hspd);

if(_vinput != 0) vspd += _vinput*acceleration_spd;
if(_vinput != 0) vspd += _vinput * acceleration_spd;
else vspd -= min(abs(vspd), deacceleration_spd) * sign(vspd);

hspd = clamp(hspd, -max_spd, max_spd);
Expand Down
13 changes: 7 additions & 6 deletions objects/obj_camera_pixel_grid/obj_camera_pixel_grid.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions objects/obj_camera_sidescroller/obj_camera_sidescroller.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions objects/obj_game_controller/obj_game_controller.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion objects/obj_player/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
hspd = 0;
vspd = 0;

spd = 1.5;
spd = 1;

anim_spd = sprite_get_speed(spr_player_moving);

Expand Down
6 changes: 3 additions & 3 deletions objects/obj_player/obj_player.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion objects/obj_player2/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ x += hspd;
y += vspd;

x = clamp(x, 0, room_width);
y = clamp(y, 0, room_height);
y = clamp(y, 0, room_height);
8 changes: 4 additions & 4 deletions objects/obj_player2/obj_player2.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions objects/obj_player_sidescroller/obj_player_sidescroller.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading