From 7b9c984cf9595f0feffe60a0d3eb147fdd75505b Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Sun, 2 Apr 2023 16:19:26 +0200 Subject: [PATCH] Fixed the zoom issue on high dpi --- source/funkin/game/PlayState.hx | 2 +- source/funkin/system/Main.hx | 2 +- source/funkin/utils/CoolUtil.hx | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 86d950dc..82a63791 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -519,7 +519,7 @@ class PlayState extends MusicBeatState // CHARACTER INITIALISATION #if REGION comboGroup = new FlxSpriteGroup(FlxG.width * 0.55, (FlxG.height * 0.5) - 60); - comboGroup.maxSize = 20; + //comboGroup.maxSize = 20; #end // SCRIPTS & STAGE INITIALISATION diff --git a/source/funkin/system/Main.hx b/source/funkin/system/Main.hx index 1f7a7269..372a9eba 100644 --- a/source/funkin/system/Main.hx +++ b/source/funkin/system/Main.hx @@ -47,7 +47,7 @@ class Main extends Sprite var gameWidth:Int = 1280; // Width of the game in pixels (might be less / more in actual pixels depending on your zoom). var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom). - var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions. + var zoom:Float = 1; // If -1, zoom is automatically calculated to fit the window dimensions. var framerate:Int = 120; // How many frames per second the game should run at. var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode. var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets diff --git a/source/funkin/utils/CoolUtil.hx b/source/funkin/utils/CoolUtil.hx index fba42a43..0e4953b9 100644 --- a/source/funkin/utils/CoolUtil.hx +++ b/source/funkin/utils/CoolUtil.hx @@ -1,5 +1,6 @@ package funkin.utils; +import flixel.tweens.FlxTween; import flixel.system.frontEnds.SoundFrontEnd; import flixel.system.FlxSound; import funkin.system.Conductor; @@ -189,7 +190,7 @@ class CoolUtil /** * Plays the main menu theme. - * @param fadeIn + * @param fadeIn */ public static function playMenuSong(fadeIn:Bool = false) { if (FlxG.sound.music == null || !FlxG.sound.music.playing) @@ -276,7 +277,7 @@ class CoolUtil * ` ` * `test2` * will return `["test1", "test2"]` - * @param path + * @param path * @return Array */ public static function coolTextFile(path:String):Array @@ -542,8 +543,11 @@ class CoolUtil spr.alpha = 1; spr.visible = true; spr.active = true; + spr.acceleration.set(); + spr.drag.set(); spr.antialiasing = FlxSprite.defaultAntialiasing; spr.rotOffset.set(); + FlxTween.cancelTweensOf(spr); } /** @@ -576,7 +580,7 @@ class CoolUtil /** * Opens an URL in the browser. - * @param url + * @param url */ public static function openURL(url:String) { #if linux @@ -598,8 +602,8 @@ class CoolUtil /** * Equivalent of `Math.max`, except doesn't require a Int -> Float -> Int conversion. - * @param p1 - * @param p2 + * @param p1 + * @param p2 * @return return p1 < p2 ? p2 : p1 */ public static inline function maxInt(p1:Int, p2:Int)