Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix PixelPerfectScaleMode on html5 #3344

Open
Geokureli opened this issue Jan 29, 2025 · 1 comment
Open

fix PixelPerfectScaleMode on html5 #3344

Geokureli opened this issue Jan 29, 2025 · 1 comment

Comments

@Geokureli
Copy link
Member

From Travis on Discord:

Q: does PixelPerfectScaleMode work on an html build?
I set it just like a do for a Windows build, which scales correctly when I resize that window.
But for the HTML build, when I resize the browser window, it scales continuously (not jumping between the pixel perfect resolutions)

@travisbattles
Copy link

Here's what I do for the HTML and Windows builds in the project.xml:

<!--HTML5-specific-->
<window if="html5" fullscreen="false" resizable="true" width="320" height="180" />

<!--Desktop-specific-->
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" width="320" height="180"/>

Here's Main.hx where I set the scaleMode:

class Main extends Sprite
{
	public function new()
	{
		super();
		addChild(new FlxGame(0, 0, MenuState));
		FlxG.scaleMode = new PixelPerfectScaleMode();
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants