Fixed the zoom issue on high dpi

This commit is contained in:
NeeEoo
2023-04-02 16:19:26 +02:00
parent ddb868f43f
commit 7b9c984cf9
3 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+9 -5
View File
@@ -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<String>
*/
public static function coolTextFile(path:String):Array<String>
@@ -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)