diff --git a/SonicTimeTwisted.gmx/SonicTimeTwisted.project.gmx b/SonicTimeTwisted.gmx/SonicTimeTwisted.project.gmx index f1e728c60..3f1aa7b9e 100644 --- a/SonicTimeTwisted.gmx/SonicTimeTwisted.project.gmx +++ b/SonicTimeTwisted.gmx/SonicTimeTwisted.project.gmx @@ -3840,7 +3840,6 @@ - diff --git a/SonicTimeTwisted.gmx/objects/objSSHud.object.gmx b/SonicTimeTwisted.gmx/objects/objSSHud.object.gmx index cf0212fb2..7d32656fb 100644 --- a/SonicTimeTwisted.gmx/objects/objSSHud.object.gmx +++ b/SonicTimeTwisted.gmx/objects/objSSHud.object.gmx @@ -328,6 +328,33 @@ top_hud_offset = tr_get_real_prop("top_hud_offset"); 1 metalProgDisplay =128 + objSSMetalSonic.progress * 280; playerProgDisplay=128 + objSSPlayer.progress * 280; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + /// Draw the pause menu and the defeat messages +if(menu.state != 0) +{ + with(menu) event_user(4); +} @@ -367,11 +394,6 @@ script_execute(hud_draw_script); draw_rectangle(0,0,426,240,false); draw_set_color(c_white); } -// this handles both the pause menu and the defeat messages -if(menu.state != 0) -{ - with(menu) event_user(4); -} diff --git a/SonicTimeTwisted.gmx/objects/objScreen.object.gmx b/SonicTimeTwisted.gmx/objects/objScreen.object.gmx index dd038f9a8..a453e31bc 100644 --- a/SonicTimeTwisted.gmx/objects/objScreen.object.gmx +++ b/SonicTimeTwisted.gmx/objects/objScreen.object.gmx @@ -47,19 +47,78 @@ view_wport[0] = width; view_hport[0] = height; if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) { - var calculated_width = get_smartphone_screen_width(); - show_debug_message("GUI: "+string(calculated_width)+" x "+string(height)); - - var maxgui_xscale = display_get_width()/calculated_width; - var maxgui_yscale = display_get_height()/height; - var maxgui_xoffset = maxgui_xscale*(calculated_width - width)/2; - - display_set_gui_size(calculated_width, height); - display_set_gui_maximise(maxgui_xscale, maxgui_yscale, maxgui_xoffset, 0); + // calculating what the definition would be if the game used the entire screen + // first, the most common case: if the screen is of an aspect ratio larger than the game's native one + var calculated_width = width; + if(os_type == os_android) + { + if(display_get_orientation() == display_portrait + || display_get_orientation() == display_portrait_flipped) + { + calculated_width = round(height * (display_get_height()/display_get_width())); + } + else + { + calculated_width = round(height * (display_get_width()/display_get_height())); + } + if(calculated_width mod 2) + { + calculated_width--; + } + } + var maxgui_xscale, maxgui_yscale; + if (calculated_width >= width) + { + // if the device's screen is wide enough, then this works + maxgui_xscale = display_get_width()/calculated_width; + maxgui_yscale = display_get_height()/height; + var maxgui_xoffset = maxgui_xscale*(calculated_width - width)/2; + + display_set_gui_size(calculated_width, height); + display_set_gui_maximise(maxgui_xscale, maxgui_yscale, maxgui_xoffset, 0); + + gui_width = calculated_width; + gui_height = height; + } + else + { + // if the device's screen is not wide enough, then restart everything: + // the width should be the fixed valuee, the height must be the recalculated instead + var calculated_height = height; + if(os_type == os_android) + { + if(display_get_orientation() == display_portrait + || display_get_orientation() == display_portrait_flipped) + { + calculated_height = round(426 * (display_get_width()/display_get_height())); + } + else + { + calculated_height = round(426 * (display_get_height()/display_get_width())); + } + if(calculated_height mod 2) + { + calculated_height--; + } + } + + maxgui_xscale = display_get_width()/width; + maxgui_yscale = display_get_height()/calculated_height; + var maxgui_yoffset = maxgui_yscale*(calculated_height - height)/2; + + display_set_gui_size(width, calculated_height); + display_set_gui_maximise(maxgui_xscale, maxgui_yscale, 0, maxgui_yoffset); + + gui_width = width; + gui_height = calculated_height; + + } } else { display_set_gui_size(width, height); + gui_width = width; + gui_height = height; } diff --git a/SonicTimeTwisted.gmx/scripts/get_smartphone_screen_width.gml b/SonicTimeTwisted.gmx/scripts/get_smartphone_screen_width.gml deleted file mode 100644 index 5593aefc0..000000000 --- a/SonicTimeTwisted.gmx/scripts/get_smartphone_screen_width.gml +++ /dev/null @@ -1,26 +0,0 @@ -/// get_smartphone_screen_width() -// Copied width and height values from objScreen, because the first use of this script comes before objScreen is initialized -if(os_type == os_android) -{ - var calculated_width; - if(display_get_orientation() == display_portrait - || display_get_orientation() == display_portrait_flipped) - { - calculated_width = round(240 * (display_get_height()/display_get_width())); - } - else - { - calculated_width = round(240 * (display_get_width()/display_get_height())); - } - - - if(calculated_width mod 2) - { - calculated_width--; - } - return calculated_width; -} -else -{ - return 426; -} diff --git a/SonicTimeTwisted.gmx/scripts/input_load_touchscreen_controls.gml b/SonicTimeTwisted.gmx/scripts/input_load_touchscreen_controls.gml index 6efea65d6..dfc317a55 100644 --- a/SonicTimeTwisted.gmx/scripts/input_load_touchscreen_controls.gml +++ b/SonicTimeTwisted.gmx/scripts/input_load_touchscreen_controls.gml @@ -1,5 +1,5 @@ // touchscreen inputs -var screen_width = get_smartphone_screen_width(); +var screen_width = objScreen.gui_width; var default_width = objScreen.width; var margin = (screen_width - default_width)/2; if(argument0) // argument0 - from INI, default values if false diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_draw_with_d3d_projection.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_draw_with_d3d_projection.gml index a1e56c137..3ab9d66e1 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_draw_with_d3d_projection.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_draw_with_d3d_projection.gml @@ -1,3 +1,3 @@ s = -1; -d3d_set_projection_ortho(-1*(internal__menu_slide_offset_x - draw_offset_x), 0, view_wport, view_hport, 0); +d3d_set_projection_ortho(-1*(internal__menu_slide_offset_x), 0, objScreen.gui_width, objScreen.gui_height, 0); script_execute(draw_script); diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_draw_with_surface.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_draw_with_surface.gml index 8d9ffcc0d..78cda74b6 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_draw_with_surface.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_draw_with_surface.gml @@ -1,13 +1,54 @@ if(!surface_exists(s)) { - if(display_get_gui_width() > 512) + var surface_width, surface_height; + + if (objScreen.gui_width > 1024) { - s = surface_create(1024, 256); + surface_width = 2048; } else { - s = surface_create(512, 256); + if (objScreen.gui_width > 512) + { + surface_width = 1024; + } + else + { + if (objScreen.gui_width > 256) + { + surface_width = 512; + } + else + { + surface_width = 256; + } + } } + + + if (objScreen.gui_height > 1024) + { + surface_height = 2048; + } + else + { + if (objScreen.gui_height > 512) + { + surface_height = 1024; + } + else + { + if (objScreen.gui_height > 256) + { + surface_height = 512; + } + else + { + surface_height = 256; + } + } + } + s = surface_create(surface_width, surface_height); } surface_set_target(s); @@ -16,5 +57,5 @@ draw_clear_alpha(c_black, 0); script_execute(draw_script); surface_reset_target(); -draw_surface(s, internal__menu_slide_offset_x - draw_offset_x, draw_offset_y); +draw_surface(s, internal__menu_slide_offset_x - draw_offset_x, -1 * draw_offset_y); diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_init.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_init.gml index bc8b1250a..b36b1b0bc 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_init.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_init.gml @@ -49,6 +49,7 @@ else draw_offset_x = 0; draw_offset_y = 0; gui_click_offset_x = 0; +gui_click_offset_y = 0; margin = 8; button_slot_height = 28; diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_open_confirmation_window.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_open_confirmation_window.gml index 78a501167..a8a574ea6 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_open_confirmation_window.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_open_confirmation_window.gml @@ -47,12 +47,8 @@ else } -var view_width = view_wview[view_current]; -if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) -{ - view_width = get_smartphone_screen_width(); -} -var view_height = view_hview[view_current]; +var view_width = objScreen.gui_width; +var view_height = objScreen.gui_height; draw_set_font(objResources.fontHudMin); internal__draw_confirmation_height = string_height_ext(confirmation_text, 0, view_width - 4*margin) + 2*margin + 40; diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_open_device_detect_window.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_open_device_detect_window.gml index a4f0f3244..741dcd749 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_open_device_detect_window.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_open_device_detect_window.gml @@ -22,12 +22,8 @@ else confirmation_no_action = -1; } -var view_width = view_wview[view_current]; -if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) -{ - view_width = get_smartphone_screen_width(); -} -var view_height = view_hview[view_current]; +var view_width = objScreen.gui_width; +var view_height = objScreen.gui_height; draw_set_font(objResources.fontHudMin); internal__draw_confirmation_height = string_height_ext(confirmation_text, 0, view_width - 4*margin) + 2*margin; diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_open_mapping_window.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_open_mapping_window.gml index 89f10d2f2..fa8884ff7 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_open_mapping_window.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_open_mapping_window.gml @@ -24,12 +24,8 @@ else confirmation_no_action = -1; } -var view_width = view_wview[view_current]; -if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) -{ - view_width = get_smartphone_screen_width(); -} -var view_height = view_hview[view_current]; +var view_width = objScreen.gui_width; +var view_height = objScreen.gui_height; draw_set_font(objResources.fontHudMin); internal__draw_confirmation_height = string_height_ext(confirmation_text, 0, view_width - 4*margin) + 2*margin; diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_open_menu.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_open_menu.gml index 4d141099a..7960810d3 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_open_menu.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_open_menu.gml @@ -18,32 +18,20 @@ if(state == 0) draw_absolutely = true; } } - /* - if(draw_absolutely) - { - draw_offset_x = 0; - draw_offset_y = 0; - } - else - { - draw_offset_x = view_xview[view_current]; - draw_offset_y = view_yview[view_current]; - } - */ if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) { - draw_offset_x = (get_smartphone_screen_width()-objScreen.width)/2; + draw_offset_x = (objScreen.gui_width-objScreen.width)/2; gui_click_offset_x = draw_offset_x; + draw_offset_y = (objScreen.gui_height-objScreen.height)/2; + gui_click_offset_y = draw_offset_y; } else { draw_offset_x = (display_get_gui_width()-objScreen.width)/2; - gui_click_offset_x = 0; - } - - show_debug_message("draw_offset_x: "+string(draw_offset_x)); - draw_offset_y = 0; - + gui_click_offset_x = 0; + draw_offset_y = 0; + gui_click_offset_y = 0; + } state = 1; timer = 0; diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_open_slider_window.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_open_slider_window.gml index 46de5f5fe..d114e00bf 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_open_slider_window.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_open_slider_window.gml @@ -10,12 +10,8 @@ confirmation_cursor = argument2; confirmation_no_action = argument3; // used as minimum instead confirmation_yes_action = argument4; // used as maximum instead -var view_width = view_wview[view_current]; -if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) -{ - view_width = get_smartphone_screen_width(); -} -var view_height = view_hview[view_current]; +var view_width = objScreen.gui_width; +var view_height = objScreen.gui_height; draw_set_font(objResources.fontHudMin); internal__draw_confirmation_height = string_height_ext(confirmation_text, 0, view_width - 4*margin)*4 + 2*margin; diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_set_scripts.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_set_scripts.gml index b1977fecf..1f9074d32 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_set_scripts.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_set_scripts.gml @@ -5,12 +5,13 @@ script_execute(item_script); // recalculate coordinates of an open menu internal__button_count = array_height_2d(items); var view_width = view_wview[view_current]; +var view_height = view_hview[view_current]; + if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) { - view_width = get_smartphone_screen_width(); + view_width = objScreen.gui_width; + view_height = objScreen.gui_height; } -var view_height = view_hview[view_current]; - internal__draw_menu_buttons_offset_y = (view_height - min(internal__button_count, button_page_count)*button_slot_height)/2; internal__draw_menu_rect_x_center = view_width/2; diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_step_default.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_step_default.gml index 57ea7448b..a9ce36685 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_step_default.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_step_default.gml @@ -183,7 +183,7 @@ switch(state) timer++; if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) { - internal__menu_slide_offset_x = timer * ceil(get_smartphone_screen_width()/-10); + internal__menu_slide_offset_x = timer * ceil(objScreen.gui_width/-10); } else { @@ -201,7 +201,7 @@ switch(state) timer++; if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) { - internal__menu_slide_offset_x = get_smartphone_screen_width() + timer * ceil(get_smartphone_screen_width()/-10); + internal__menu_slide_offset_x = objScreen.gui_width + timer * ceil(objScreen.gui_width/-10); } else { @@ -220,7 +220,7 @@ switch(state) if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) { - internal__menu_slide_offset_x = max(timer * ceil(get_smartphone_screen_width()/10), internal__menu_slide_offset_x); + internal__menu_slide_offset_x = max(timer * ceil(objScreen.gui_width/10), internal__menu_slide_offset_x); } else { @@ -239,7 +239,7 @@ switch(state) timer++; if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) { - internal__menu_slide_offset_x = -1*get_smartphone_screen_width() + timer * ceil(get_smartphone_screen_width()/10); + internal__menu_slide_offset_x = -1*objScreen.gui_width + timer * ceil(objScreen.gui_width/10); } else { diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_touchscreen_default.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_touchscreen_default.gml index 2d939111c..80e08551d 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_touchscreen_default.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_touchscreen_default.gml @@ -8,7 +8,7 @@ switch(state) if(mouse_check_button(mb_left)) { mx = device_mouse_x_to_gui(0) + gui_click_offset_x; - my = device_mouse_y_to_gui(0); + my = device_mouse_y_to_gui(0) + gui_click_offset_y; if(mx >= internal__draw_menu_rect_x2 - margin * 2 && mx <= internal__draw_menu_rect_x2) { @@ -137,7 +137,7 @@ switch(state) if(scroll == round(scroll)) { mx = device_mouse_x_to_gui(0) + gui_click_offset_x - internal__draw_menu_rect_x1; - my = device_mouse_y_to_gui(0) - internal__draw_menu_rect_y1; + my = device_mouse_y_to_gui(0) + gui_click_offset_y - internal__draw_menu_rect_y1; if(mx >= margin && mx <= margin + button_width) { if(my >= margin) @@ -153,7 +153,7 @@ switch(state) else { mx = device_mouse_x_to_gui(0) + gui_click_offset_x - internal__draw_menu_rect_x1; - my = device_mouse_y_to_gui(0) - internal__draw_menu_rect_y1; + my = device_mouse_y_to_gui(0) + gui_click_offset_y - internal__draw_menu_rect_y1; if(mx >= margin && mx <= margin + button_width) { if(my >= margin - (button_slot_height div 2)) @@ -198,7 +198,7 @@ switch(state) if(mouse_check_button_pressed(mb_left)) { mx = device_mouse_x_to_gui(0) + gui_click_offset_x; - my = device_mouse_y_to_gui(0); + my = device_mouse_y_to_gui(0) + gui_click_offset_y; if(mx < internal__draw_confirmation_rect_x1 || mx > internal__draw_confirmation_rect_x2 || my < internal__draw_confirmation_rect_y1 || my > internal__draw_confirmation_rect_y2) @@ -240,7 +240,7 @@ switch(state) if(mouse_check_button_pressed(mb_left)) { mx = device_mouse_x_to_gui(0) + gui_click_offset_x; - my = device_mouse_y_to_gui(0); + my = device_mouse_y_to_gui(0) + gui_click_offset_y; if(mx < internal__draw_confirmation_rect_x1 || mx > internal__draw_confirmation_rect_x2 || my < internal__draw_confirmation_rect_y1 || my > internal__draw_confirmation_rect_y2) @@ -261,7 +261,7 @@ switch(state) if(mouse_check_button_pressed(mb_left)) { mx = device_mouse_x_to_gui(0) + gui_click_offset_x; - my = device_mouse_y_to_gui(0); + my = device_mouse_y_to_gui(0) + gui_click_offset_y; if(mx < internal__draw_confirmation_rect_x1 || mx > internal__draw_confirmation_rect_x2 || my < internal__draw_confirmation_rect_y1 || my > internal__draw_confirmation_rect_y2) @@ -275,7 +275,7 @@ switch(state) { // updating value mx = device_mouse_x_to_gui(0) + gui_click_offset_x; - my = device_mouse_y_to_gui(0); + my = device_mouse_y_to_gui(0) + gui_click_offset_y; confirmation_prev_cursor = -1; if(mx >= internal__draw_confirmation_rect_x_center - 100 && mx <= internal__draw_confirmation_rect_x_center + 100) { diff --git a/SonicTimeTwisted.gmx/scripts/menu_fn_update_mapping_window.gml b/SonicTimeTwisted.gmx/scripts/menu_fn_update_mapping_window.gml index 38d693071..b25eb7639 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_fn_update_mapping_window.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_fn_update_mapping_window.gml @@ -2,12 +2,8 @@ confirmation_text = argument[0]; -var view_width = view_wview[view_current]; -if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) -{ - view_width = get_smartphone_screen_width(); -} -var view_height = view_hview[view_current]; +var view_width = objScreen.gui_width; +var view_height = objScreen.gui_height; draw_set_font(objResources.fontHudMin); internal__draw_confirmation_height = string_height_ext(confirmation_text, 0, view_width - 4*margin) + 2*margin; diff --git a/SonicTimeTwisted.gmx/scripts/menu_part_buttonreposition_confirm_actions.gml b/SonicTimeTwisted.gmx/scripts/menu_part_buttonreposition_confirm_actions.gml index 71e38f7ca..6f53ca740 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_part_buttonreposition_confirm_actions.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_part_buttonreposition_confirm_actions.gml @@ -24,7 +24,7 @@ switch(argument0) temporary_variable = -1; with(objProgram.inputManager) { - var screen_width = get_smartphone_screen_width(); + var screen_width = objScreen.gui_width; var default_width = objScreen.width; var margin = (screen_width - default_width)/2; dpadx = 64 - margin; diff --git a/SonicTimeTwisted.gmx/scripts/menu_part_buttonreposition_draw.gml b/SonicTimeTwisted.gmx/scripts/menu_part_buttonreposition_draw.gml index aadc229c7..4cb333639 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_part_buttonreposition_draw.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_part_buttonreposition_draw.gml @@ -9,30 +9,32 @@ if(is_array(temporary_variable)) draw_set_color(c_white); var x_test; var x_delta = 0; + var y_delta = 0; if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) { - x_test = get_smartphone_screen_width()/2; - x_delta = (get_smartphone_screen_width() - objScreen.width)/2; + x_test = objScreen.gui_width/2; + x_delta = (objScreen.gui_width - objScreen.width)/2; + y_delta = (objScreen.gui_height - objScreen.height)/2; } else { - x_test = objScreen.width; + x_test = objScreen.width/2; } - draw_text(x_test, 0, tr("_options_menu_touchscreen_buttonreposition_back")); + draw_text(x_test, y_delta, tr("_options_menu_touchscreen_buttonreposition_back")); draw_sprite(dpadSprite, 0, temporary_variable[5, 1] + x_delta, - temporary_variable[5, 2]); + temporary_variable[5, 2] + y_delta); draw_sprite(buttonSprite, 0, temporary_variable[6, 1] + x_delta, - temporary_variable[6, 2]); + temporary_variable[6, 2] + y_delta); draw_sprite(sprTouchscreenPauseButton, 0, temporary_variable[7, 1] + x_delta, - temporary_variable[7, 2]); + temporary_variable[7, 2] + y_delta); draw_sprite(sprTouchscreenSuperButtonYellow, 0, temporary_variable[8, 1] + x_delta, - temporary_variable[8, 2]); + temporary_variable[8, 2] + y_delta); } diff --git a/SonicTimeTwisted.gmx/scripts/menu_part_gyroscope_draw.gml b/SonicTimeTwisted.gmx/scripts/menu_part_gyroscope_draw.gml index 92bf2e5be..fd63b43aa 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_part_gyroscope_draw.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_part_gyroscope_draw.gml @@ -50,15 +50,7 @@ with(objProgram.inputManager) } } -var x_center; -if(DEVICE_INFO & DEVICE_TYPE_SMARTPHONE) -{ - x_center = get_smartphone_screen_width()/2 - 8; -} -else -{ - x_center = objScreen.width/2 - 8; -} +var x_center = objScreen.gui_width/2 - 8; if(objProgram.inputManager.gyromode == 0) { draw_sprite(sprGyroscopeTest, 0, x_center, 208); diff --git a/SonicTimeTwisted.gmx/scripts/menu_part_levelselect_char_touchscreen.gml b/SonicTimeTwisted.gmx/scripts/menu_part_levelselect_char_touchscreen.gml index df03a450e..e483219ec 100644 --- a/SonicTimeTwisted.gmx/scripts/menu_part_levelselect_char_touchscreen.gml +++ b/SonicTimeTwisted.gmx/scripts/menu_part_levelselect_char_touchscreen.gml @@ -40,7 +40,7 @@ if(state == 2 || state == 3) if(internal__touch_len < 4) { mx = device_mouse_x_to_gui(0) + gui_click_offset_x - internal__draw_menu_rect_x1; - my = device_mouse_y_to_gui(0) - internal__draw_menu_rect_y1; + my = device_mouse_y_to_gui(0) + gui_click_offset_y - internal__draw_menu_rect_y1; if(mx >= margin && mx <= margin + button_width) { if(my >= margin)