Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:goupilmtos:2024:games
Minilens
fix-screen-resizing.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-screen-resizing.patch of Package Minilens
diff -Nur minilens-1.2/engine.cfg new/engine.cfg --- minilens-1.2/engine.cfg 2016-04-17 18:03:01.000000000 +0200 +++ new/engine.cfg 2016-06-27 21:16:10.797868332 +0200 @@ -20,7 +20,7 @@ config="res://shared/config.gd" SaveManager="*res://shared/save_manager.gd" -ScreenManager="res://shared/screen_manager.gd" +ScreenManager="*res://shared/screen_manager.gd" ScenesManager="*res://shared/scenes_manager.gd" SettingsManager="*res://shared/settings_manager.gd" FileManager="*res://shared/file_manager.gd" diff -Nur minilens-1.2/main/gui.gd new/main/gui.gd --- minilens-1.2/main/gui.gd 2016-04-17 18:03:01.000000000 +0200 +++ new/main/gui.gd 2016-06-27 21:16:10.797868332 +0200 @@ -13,6 +13,8 @@ onready var JS = get_node("/root/SUTjoystick") func _ready(): + ScreenManager.set_minimum_size(Vector2(0, 0)) + var nodes_left = get_node("popup/popup_node/body/container").get_children() # Removes the focus from the buttons diff -Nur minilens-1.2/main/level_holder.gd new/main/level_holder.gd --- minilens-1.2/main/level_holder.gd 2016-04-17 18:03:01.000000000 +0200 +++ new/main/level_holder.gd 2016-06-27 21:16:10.797868332 +0200 @@ -88,6 +88,8 @@ func window_resize(): var new_size = get_node("/root").get_size_override() + if !level_node: + return var tilemap = level_node.get_node("tilemap") for i in range(ceil(new_size.x/2/64)): tilemap.set_cell(tile_map_acid_x_start - i, tile_map_acid_y, 2) diff -Nur minilens-1.2/main/main.tscn new/main/main.tscn --- minilens-1.2/main/main.tscn 2016-04-17 18:03:01.000000000 +0200 +++ new/main/main.tscn 2016-06-27 21:16:10.801868354 +0200 @@ -47,7 +47,7 @@ margin/left = 8.0 margin/top = 8.0 margin/right = 8.0 -margin/bottom = 68.0 +margin/bottom = 76.0 alignment = 0 __meta__ = { "_editor_collapsed":true } @@ -799,6 +799,7 @@ [node name="player" parent="player_holder" instance=ExtResource( 16 )] transform/pos = Vector2( 228.814, 197.081 ) +collision/margin = 0.08 [node name="sample_player" type="SamplePlayer" parent="."] diff -Nur minilens-1.2/menu/menu.gd new/menu/menu.gd --- minilens-1.2/menu/menu.gd 2016-04-17 18:03:01.000000000 +0200 +++ new/menu/menu.gd 2016-06-27 21:16:10.801868354 +0200 @@ -25,9 +25,18 @@ if node.has_node("back"): node.get_node("back").connect("pressed", self, "go_to_target", ["start"]) + # Screen size + var minimum_size = get_minimum_size() + for child in get_children(): + if child extends Control: + var child_minimum_size = child.get_minimum_size() + minimum_size.x = max(minimum_size.x, child_minimum_size.x) + minimum_size.y = max(minimum_size.y, child_minimum_size.y) + ScreenManager.set_minimum_size(minimum_size) + # Splash fadeout if ScenesManager.is_first_load: - get_node("initial_splash/animation_player").play("SplashFade") + get_node("animation_player").play("SplashFade") # Prepare to move thing when the aspect ratio changes connect("resized", self, "reposition_screens") @@ -38,7 +47,6 @@ if size == old_size: return - old_size = size levels.set_margin(MARGIN_LEFT, size.x) @@ -50,15 +58,21 @@ credits.set_margin(MARGIN_TOP, size.y) credits.set_margin(MARGIN_BOTTOM, -size.y) - var scale = size.x/1024 - if scale > 1: + var initial_size = ScreenManager.get_original_size() + var scale_vector = size / initial_size + var scale = max(scale_vector.x, scale_vector.y) + + if scale > 1: get_node("background_layer").set_scale(Vector2(scale,scale)) - get_node("background_layer").set_offset(Vector2(0,-(scale*768-768))) - get_node("initial_splash").set_scale(Vector2(scale,scale)) - get_node("initial_splash").set_offset(Vector2(0,-(scale*768-768)/2)) - go_to_target(current_screen) + get_node("initial_splash").set_offset((size - initial_size) * Vector2(0.5, 0)) + if scale_vector.y / scale_vector.x < 1: + get_node("background_layer").set_offset(Vector2(0, (1 - scale_vector.x / scale_vector.y) * initial_size.y)) + else: + get_node("background_layer").set_offset(Vector2(0, 0)) + tween.remove_all() + go_to_target(current_screen, false) -func go_to_target(var screen = "start"): +func go_to_target(screen = "start", animate = true): current_screen = screen var target_coordinates = Vector2(0, 0) # By default, use the 0, 0 coordinates @@ -70,8 +84,12 @@ var time = distance/screen_move_speed if time > 0: - tween.interpolate_property(self, "rect/pos", current_coordinates, -target_coordinates, time, Tween.TRANS_EXPO, Tween.EASE_OUT, 0) - tween.start() + tween.remove_all() + if animate: + tween.interpolate_property(self, "rect/pos", current_coordinates, -target_coordinates, time, Tween.TRANS_EXPO, Tween.EASE_OUT, 0) + tween.start() + else: + set("rect/pos", -target_coordinates) func quit(): get_tree().quit() # Exit the game diff -Nur minilens-1.2/menu/menu.tscn new/menu/menu.tscn --- minilens-1.2/menu/menu.tscn 2016-04-17 18:03:01.000000000 +0200 +++ new/menu/menu.tscn 2016-06-27 21:16:10.801868354 +0200 @@ -28,17 +28,6 @@ [sub_resource type="Animation" id=2] -resource/name = "SplashFade" -length = 2.0 -loop = false -step = 0.1 -tracks/0/type = "value" -tracks/0/path = NodePath("image:visibility/opacity") -tracks/0/interp = 1 -tracks/0/keys = { "cont":true, "times":FloatArray( 0, 1, 2 ), "transitions":FloatArray( 1, 1, 1 ), "values":[ 1.0, 1.0, 0.0 ] } - -[sub_resource type="Animation" id=3] - length = 1.0 loop = true step = 0.1 @@ -51,6 +40,20 @@ tracks/1/interp = 1 tracks/1/keys = { "cont":true, "times":FloatArray( 0, 0.5 ), "transitions":FloatArray( 1, 1 ), "values":[ Vector2( 1, 1 ), Vector2( 1.2, 1.2 ) ] } +[sub_resource type="Animation" id=3] + +length = 2.0 +loop = false +step = 0.1 +tracks/0/type = "value" +tracks/0/path = NodePath("initial_splash/image:visibility/opacity") +tracks/0/interp = 1 +tracks/0/keys = { "cont":true, "times":FloatArray( 0, 1, 2 ), "transitions":FloatArray( 1, 1, 1 ), "values":[ 1.0, 1.0, 0.0 ] } +tracks/1/type = "value" +tracks/1/path = NodePath("background_layer/background:visibility/opacity") +tracks/1/interp = 1 +tracks/1/keys = { "cont":true, "times":FloatArray( 0, 2 ), "transitions":FloatArray( 1, 1 ), "values":[ 0.0, 1.0 ] } + [node name="menu" type="Control"] anchor/right = 1 @@ -117,17 +120,6 @@ texture = ExtResource( 4 ) expand = true -[node name="animation_player" type="AnimationPlayer" parent="initial_splash"] - -playback/process_mode = 1 -playback/default_blend_time = 0.0 -root/root = NodePath("..") -anims/SplashFade = SubResource( 2 ) -playback/active = true -playback/speed = 3.0 -blend_times = [ ] -autoplay = "" - [node name="main" type="VBoxContainer" parent="."] anchor/right = 1 @@ -139,7 +131,7 @@ size_flags/vertical = 3 margin/left = 0.0 margin/top = 16.0 -margin/right = 0.0 +margin/right = -4.0 margin/bottom = 0.0 custom_constants/separation = 20 alignment = 0 @@ -151,17 +143,18 @@ size_flags/horizontal = 1 size_flags/vertical = 1 size_flags/stretch_ratio = 3.0 -margin/left = 198.0 +margin/left = 200.0 margin/top = 26.0 -margin/right = 825.0 +margin/right = 827.0 margin/bottom = 179.0 texture = ExtResource( 5 ) __meta__ = { "_editor_collapsed":true } [node name="splash" type="Node2D" parent="main/logo"] -transform/pos = Vector2( 618.213, 157.035 ) +transform/pos = Vector2( 602.573, 151.655 ) transform/rot = 15.0502 +transform/scale = Vector2( 1, 1 ) z/z = 4 script/script = ExtResource( 6 ) __meta__ = { "_editor_collapsed":true } @@ -194,7 +187,7 @@ playback/process_mode = 1 playback/default_blend_time = 0.0 root/root = NodePath("..") -anims/loop = SubResource( 3 ) +anims/loop = SubResource( 2 ) playback/active = true playback/speed = 0.2 blend_times = [ ] @@ -220,9 +213,9 @@ size_flags/horizontal = 1 size_flags/vertical = 1 size_flags/stretch_ratio = 3.0 -margin/left = 312.0 +margin/left = 314.0 margin/top = 226.0 -margin/right = 712.0 +margin/right = 714.0 margin/bottom = 526.0 custom_constants/vseparation = 10 custom_constants/hseparation = 10 @@ -294,7 +287,7 @@ size_flags/stretch_ratio = 2.0 margin/left = 0.0 margin/top = 564.0 -margin/right = 1024.0 +margin/right = 1028.0 margin/bottom = 664.0 custom_constants/separation = 40 alignment = 1 @@ -307,9 +300,9 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 1 -margin/left = 237.0 +margin/left = 239.0 margin/top = 0.0 -margin/right = 514.0 +margin/right = 516.0 margin/bottom = 100.0 texture = ExtResource( 7 ) expand = true @@ -321,9 +314,9 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 2 -margin/left = 554.0 +margin/left = 556.0 margin/top = 0.0 -margin/right = 787.0 +margin/right = 789.0 margin/bottom = 100.0 texture = ExtResource( 8 ) expand = true @@ -336,7 +329,7 @@ size_flags/horizontal = 2 margin/left = 0.0 margin/top = 703.0 -margin/right = 1024.0 +margin/right = 1028.0 margin/bottom = 751.0 custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "© 2015-2016 KOBUGE Games - kobuge-games.github.io/minilens" @@ -711,4 +704,15 @@ playback/repeat = false playback/speed = 1.0 +[node name="animation_player" type="AnimationPlayer" parent="."] + +playback/process_mode = 1 +playback/default_blend_time = 0.0 +root/root = NodePath("..") +anims/SplashFade = SubResource( 3 ) +playback/active = true +playback/speed = 3.0 +blend_times = [ ] +autoplay = "" + diff -Nur minilens-1.2/shared/screen_manager.gd new/shared/screen_manager.gd --- minilens-1.2/shared/screen_manager.gd 2016-04-17 18:03:01.000000000 +0200 +++ new/shared/screen_manager.gd 2016-06-27 21:16:10.801868354 +0200 @@ -4,24 +4,36 @@ onready var viewport = get_viewport() onready var initial_size = viewport.get_rect().size +var minimum_size = Vector2(0, 0) + func _ready(): + if Globals.has("display/width"): + initial_size.x = Globals.get("display/width") + if Globals.has("display/height"): + initial_size.y = Globals.get("display/height") + viewport.connect("size_changed", self, "window_resize") window_resize() +func set_minimum_size(s): + if minimum_size != s: + minimum_size = s + window_resize() + +func get_original_size(): + return initial_size + func window_resize(): var current_size = OS.get_window_size() - var changed = false - if current_size.x < 100: - current_size.x = 100 - changed = true - if current_size.y < 100: - current_size.y = 100 - changed = true - - if changed: - OS.set_window_size(current_size) - var scale_factor = initial_size.y/current_size.y var new_size = Vector2(current_size.x*scale_factor, initial_size.y) + + if new_size.y < minimum_size.y: + scale_factor = minimum_size.y/new_size.y + new_size = Vector2(new_size.x*scale_factor, minimum_size.y) + if new_size.x < minimum_size.x: + scale_factor = minimum_size.x/new_size.x + new_size = Vector2(minimum_size.x, new_size.y*scale_factor) + viewport.set_size_override(true, new_size)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor