Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
39 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
4e8d59d
fixed test breaking issues
stann-co Feb 17, 2026
81ffa7a
indentation
stann-co Feb 17, 2026
bd4d330
remove divide by 1, it is unnecesary
stann-co Feb 17, 2026
e757999
smooth draw off by default
stann-co Feb 17, 2026
79d5230
10 steps after fullscreen switching was 1 step too few
stann-co Feb 17, 2026
3d3e35f
Merge branch 'master' into big-overhaul-2.4
stann-co Feb 17, 2026
886df89
Fix spacing
bfrymire Feb 17, 2026
6535f78
Add semicolons
bfrymire Feb 17, 2026
b130558
Simplify updating camera position
bfrymire Feb 17, 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
5 changes: 1 addition & 4 deletions fonts/f_hires/f_hires.yy

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

5 changes: 1 addition & 4 deletions fonts/f_pixel/f_pixel.yy

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

9 changes: 9 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,19 @@ 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;

__switching_window_mode = false;

draw_zones = false;

__gui_res_w = 1;
__gui_res_h = 1;
__gui_x_scale = 1;
__gui_y_scale = 1;
2 changes: 1 addition & 1 deletion objects/__obj_stanncam_manager/Draw_76.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ var _len = array_length(global.stanncams);
for (var i = 0; i < _len; ++i){
if(global.stanncams[i] == -1) continue;
global.stanncams[i].__predraw();
}
}
6 changes: 6 additions & 0 deletions objects/__obj_stanncam_manager/Draw_77.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// @description
var _len = array_length(global.stanncams);
for (var i = 0; i < _len; ++i){
if(global.stanncams[i] == -1) continue;
global.stanncams[i].__postdraw();
}
10 changes: 8 additions & 2 deletions objects/__obj_stanncam_manager/Other_4.gml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
view_enabled = true;
var _len = array_length(global.stanncams);
for (var i = 0; i < _len; ++i){
if(global.stanncams[i] == -1) continue;
global.stanncams[i].__check_viewports();
var _cam = global.stanncams[i];
if(_cam == -1) continue;
_cam.__check_viewports();

//if following something snaps to it on room start
if(instance_exists(_cam.follow)){
_cam.move(_cam.follow.x,_cam.follow.y,0);
}
}
__stanncam_update_resolution();
2 changes: 1 addition & 1 deletion objects/__obj_stanncam_manager/Step_2.gml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ for (var i = 0; i < _len; ++i){
}

//constantly checks if the window is being resized and changes the resolution to match
if(global.window_mode == STANNCAM_WINDOW_MODE.WINDOWED && (resize_width != window_get_width() || resize_height != window_get_height())){
if(global.window_mode == STANNCAM_WINDOW_MODE.WINDOWED && !__switching_window_mode && (resize_width != window_get_width() || resize_height != window_get_height())){
resize_width = window_get_width();
resize_height = window_get_height();

Expand Down
9 changes: 5 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 = 10;
cam1.bounds_h = 10;

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);
6 changes: 6 additions & 0 deletions objects/obj_camera/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// @description
var _x = cam1.get_mouse_x();
var _y = cam1.get_mouse_y();
draw_set_color(c_red);
draw_circle(_x,_y,10,true);
draw_set_color(c_white);
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_73.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// @description
var _x = cam1.get_mouse_x();
var _y = cam1.get_mouse_y();
draw_set_color(c_green);
draw_circle(_x,_y,10,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);
7 changes: 4 additions & 3 deletions objects/obj_camera/Mouse_60.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var _zoom_amount = cam1.zoom_amount;
_zoom_amount -= 0.05;
_zoom_amount = clamp(_zoom_amount, 0.1, 2);
cam1.zoom(_zoom_amount, 0);
_zoom_amount -= 0.01;
_zoom_amount = clamp(_zoom_amount, 0.1, 3);
cam1.zoom(_zoom_amount, 0);
obj_tv.tv.zoom(_zoom_amount, 0);
5 changes: 3 additions & 2 deletions objects/obj_camera/Mouse_61.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var _zoom_amount = cam1.zoom_amount;
_zoom_amount += 0.05;
_zoom_amount = clamp(_zoom_amount, 0.1, 2);
_zoom_amount += 0.01;
_zoom_amount = clamp(_zoom_amount, 0.1, 3);
cam1.zoom(_zoom_amount, 0);
obj_tv.tv.zoom(_zoom_amount, 0);
45 changes: 26 additions & 19 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 All @@ -62,8 +52,8 @@ if(mouse_check_button_pressed(mb_right)){
break;
case 2:
//zoom out
cam1.zoom(2, GAME_SPEED * 1);
obj_tv.tv.zoom(2, GAME_SPEED * 1);
cam1.zoom(3, GAME_SPEED * 1);
obj_tv.tv.zoom(3, GAME_SPEED * 1);
break;
}
}
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 All @@ -146,4 +153,4 @@ if(keyboard_check_pressed(vk_f4)){
}

stanncam_set_window_mode(_window_mode);
}
}
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.

4 changes: 2 additions & 2 deletions objects/obj_camera_pixel_grid/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ zoom_mode = 0;
zoom_text = cam1.zoom_amount

game_res = 0;

resolutions = [
{w:400, h:400}, //1:1
{w:500, h:250}, //2:1
{w:320, h:180}, //16:9
{w:1000, h:1000}, //1:1
{w:1280, h:720},
{w:1920, h:1080}
{w:1280, h:720}
];


Expand Down
9 changes: 9 additions & 0 deletions objects/obj_camera_pixel_grid/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// @description
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)
24 changes: 19 additions & 5 deletions objects/obj_camera_pixel_grid/Draw_64.gml
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
//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);

//draws circle in center of room
var cx = cam1.room_to_gui_x(room_width/2 -1);
var cy = cam1.room_to_gui_y(room_height/2 -1);

draw_circle(cx,cy,20,true);

var _outline_width = 1;
var _precision = 8;
var _offset = 10;
Expand Down Expand Up @@ -37,9 +55,5 @@ 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());
draw_set_halign(fa_left);
draw_text(mx, my, $"{mx} {my}");


draw_text(dx, dy, $"{dx} {dy}");
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)
2 changes: 1 addition & 1 deletion objects/obj_camera_pixel_grid/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ if(hspd != 0 || vspd != 0){
var _x = cam1.x + hspd;
var _y = cam1.y + vspd;
cam1.move(_x, _y, 0);
}
}
Loading