Wisheechia Posted August 6, 2019 Share Posted August 6, 2019 Hi guys, I need help with my game. I'm working on game/background resizing. Actually, I improved my game resize function studying this article (http://www.williammalone.com/articles/html5-game-scaling/, the second part doesnt work for me..), so now I have problem with scaling background to a safe area. Can someone help me? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 6, 2019 Share Posted August 6, 2019 Things that you have to study (look in docs, source code): 1. Renderer.resize and its super. 2. container.position, container.scale, container.pivot. If you want to do something in center of screen. position = center, pivot=local coords of that center. Go figure out how those two work. 3. CSS resize. "canvas.width" and "canvas.style.width" are different things. you can scale canvas instead and get a result. Also margin-left margin-top and other CSS things. Algorithm that is suited for your game is born from those three things. Unfortunately, only a few people made that and reported back their findings, and I cant solve every person issues because, actually, its different for everyone If you solve your case , please make an article or at least small post here, maybe we'll get to more general case based on everything people report Someone's medium article: https://medium.com/@michelfariarj/scale-a-pixi-js-game-to-fit-the-screen-1a32f8730e9c More of those threads: quiphop 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 6, 2019 Share Posted August 6, 2019 Welcome to the forums! Also, this plugin might be related: https://github.com/davidfig/pixi-viewport Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.