Skip to content

Commit ae55ccf

Browse files
committed
Position windows correctly in the center when scaling the window
1 parent 383d62a commit ae55ccf

File tree

28 files changed

+59
-58
lines changed

28 files changed

+59
-58
lines changed

scripts/draw_downloadprogress/draw_downloadprogress.gml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ function draw_downloadprogress(argument0, argument1, argument2, argument3) {
88
percent = done/total
99
done_mb = done/power(1024, 2)
1010
total_mb = total/power(1024, 2)
11-
x1 = floor(window_width / 2 - 150)
12-
y1 = floor(window_height / 2 - 50)
11+
x1 = floor(rw / 2 - 150)
12+
y1 = floor(rh / 2 - 50)
1313
draw_theme_color()
1414
draw_window(x1, y1, x1 + 300, y1 + 100)
1515
draw_set_font(fnt_mainbold)
1616
draw_text(x1 + 16, y1 + 16, caption)
1717
draw_set_font(fnt_main)
1818
draw_set_halign(fa_center)
19-
draw_text(floor(window_width / 2), y1 + 40, desc)
19+
draw_text(floor(rw / 2), y1 + 40, desc)
2020
draw_set_color(10512464)
2121
draw_rectangle(x1 + 30, y1 + 60, x1 + 30 + percent * 240, y1 + 80, 0)
2222
draw_theme_color()
@@ -30,7 +30,7 @@ function draw_downloadprogress(argument0, argument1, argument2, argument3) {
3030
total_text = string_format(total_mb, 0, 2)
3131
}
3232
text = done_text + "/" + total_text + " MB (" + string(round(percent * 100)) + "%)"
33-
draw_text(floor(window_width / 2), y1 + 65, text)
33+
draw_text(floor(rw / 2), y1 + 65, text)
3434
draw_set_halign(fa_left)
3535

3636

scripts/draw_notechart/draw_notechart.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ function draw_notechart(argument0, argument1, argument2, argument3) {
22
// draw_notechart(x, y, key, sharp)
33
var x1, xx, yy, key, sharp, a;
44
x1 = argument0
5-
xx = median(0, x1 - 32, window_width - 320)
5+
xx = median(0, x1 - 32, rw - 320)
66
yy = argument1
77
key = argument2
88
sharp = argument3
99
draw_sprite(spr_notechart, 0 + 3 * theme, xx, yy - 320 + 1)
10-
draw_sprite(spr_notechart, (1 + (x1 > window_width - 250)) + 3 * theme, x1 - 16 * (x1 > window_width - 250), yy)
10+
draw_sprite(spr_notechart, (1 + (x1 > rw - 250)) + 3 * theme, x1 - 16 * (x1 > rw - 250), yy)
1111

1212
draw_set_color(0)
1313
draw_set_alpha(0.25)

scripts/draw_window_about/draw_window_about.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
function draw_window_about() {
22
// draw_window_stats()
33
var x1, y1, a, n;
4-
x1 = floor(window_width / 2 - 150)
5-
y1 = floor(window_height / 2 - 200)
4+
x1 = floor(rw / 2 - 150)
5+
y1 = floor(rh / 2 - 200)
66
draw_window(x1, y1, x1 + 300, y1 + 400)
77
draw_set_font(fnt_mainbold)
88
draw_text(x1 + 8, y1 + 8, "About")

scripts/draw_window_branch_export/draw_window_branch_export.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ function draw_window_branch_export() {
22
// draw_window_branch_export()
33
var x1, y1, a, b, c, d, str, nsel, tabs, tabstr, tabw, tabtip, menun, menua, menub, block, c1, c2;
44
curs = cr_default
5-
x1 = floor(window_width / 2 - 275)
6-
y1 = floor(window_height / 2 - 200)
5+
x1 = floor(rw / 2 - 275)
6+
y1 = floor(rh / 2 - 200)
77
draw_window(x1, y1, x1 + 550, y1 + 400)
88
draw_set_font(fnt_mainbold)
99
draw_text(x1 + 8, y1 + 8, "Branch Export")

scripts/draw_window_clip_editor/draw_window_clip_editor.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ function draw_window_clip_editor() {
22
// draw_window_clip_editor()
33
var x1, y1;
44
curs = cr_default
5-
x1 = floor(window_width / 2 - 220)
6-
y1 = floor(window_height / 2 - 215)
5+
x1 = floor(rw / 2 - 220)
6+
y1 = floor(rh / 2 - 215)
77
draw_window(x1, y1, x1 + 440, y1 + 430)
88
draw_set_font(fnt_mainbold)
99
draw_text(x1 + 8, y1 + 8, "Secret Clipboard Editor")

scripts/draw_window_datapack_export/draw_window_datapack_export.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ function draw_window_datapack_export() {
22
// draw_window_datapack_export()
33
var x1, y1, a, b, c, d, str, nsel, tabs, tabstr, tabw, tabtip, menun, menua, menub, block, blocks, c1, c2;
44
curs = cr_default
5-
x1 = floor(window_width / 2 - 275)
6-
y1 = floor(window_height / 2 - 215)
5+
x1 = floor(rw / 2 - 275)
6+
y1 = floor(rh / 2 - 215)
77
draw_window(x1, y1, x1 + 550, y1 + 430)
88
draw_set_font(fnt_mainbold)
99
draw_text(x1 + 8, y1 + 8, "Data Pack Export")

scripts/draw_window_greeting/draw_window_greeting.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ function draw_window_greeting() {
22
// draw_window_greeting()
33
var x1, y1, a, b, c, d, e, m;
44
curs = cr_default
5-
x1 = floor(window_width / 2 - 350)
6-
y1 = floor(window_height / 2 - 210)
5+
x1 = floor(rw / 2 - 350)
6+
y1 = floor(rh / 2 - 210)
77
draw_window(x1, y1, x1 + 700, y1 + 430)
88
draw_sprite_ext(spr_logo, 0, x1 + 64, y1 + 50, 0.55, 0.55, 0, c_white, 1)
99
draw_set_font(fnt_info_med_bold)

scripts/draw_window_instruments/draw_window_instruments.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ function draw_window_instruments() {
33
var x1, y1, a, b, c, str, menun, menua, menub, prev;
44
curs = cr_default
55
menun = -1
6-
x1 = floor(window_width / 2 - 275)
7-
y1 = floor(window_height / 2 - 175)
6+
x1 = floor(rw / 2 - 275)
7+
y1 = floor(rh / 2 - 175)
88
draw_window(x1, y1, x1 + 550, y1 + 350)
99
draw_set_font(fnt_mainbold)
1010
draw_text(x1 + 10, y1 + 8, "Instrument Settings")

scripts/draw_window_macro_arpeggio/draw_window_macro_arpeggio.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ function draw_window_macro_arpeggio() {
44
curs = cr_default
55
text_exists[0] = 0
66
if (selected = 0) return 0
7-
x1 = floor(window_width / 2 - 80)
8-
y1 = floor(window_height / 2 - 80)
7+
x1 = floor(rw / 2 - 80)
8+
y1 = floor(rh / 2 - 80)
99
draw_window(x1, y1, x1 + 140, y1 + 130)
1010
draw_set_font(fnt_mainbold)
1111
draw_text(x1 + 8, y1 + 8, "Arpeggio")

scripts/draw_window_macro_portamento/draw_window_macro_portamento.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ function draw_window_macro_portamento() {
44
curs = cr_default
55
text_exists[0] = 0
66
if (selected = 0) return 0
7-
x1 = floor(window_width / 2 - 80)
8-
y1 = floor(window_height / 2 - 80)
7+
x1 = floor(rw / 2 - 80)
8+
y1 = floor(rh / 2 - 80)
99
draw_window(x1, y1, x1 + 140, y1 + 130)
1010
draw_set_font(fnt_mainbold)
1111
draw_text(x1 + 8, y1 + 8, "Portamento")

0 commit comments

Comments
 (0)