Scaling canvas size based on browser performance?

0 favourites
  • 5 posts
From the Asset Store
Human/Character Base Pixel Art Sprites in various poses (nearly 100 files)
  • I have a site:

    8bitwidgets.com

    this site runs fine on any computer with a decent GPU, but there are a lot of computers out there that unfortunately do not and on those computers, my site runs really bad.

    So one quick solution is that I noticed if i scale down the size of the browser, the frame rate does go up to something perfectly acceptable.

    however, asking a user to resize their browser is not realistic.. so it got me thinking maybe i could have an kind of FPS counter and depending on the score, I could auto size the canvas to improve performance automatically.

    Can the canvas be resized in realtime? dynamically? or does it always fill the index.html

  • You could use the cpuutilization function to get an idea of how much impact your project has and then using the set canvas size in the System object to resize until the cpuutilization reaches an acceptable point.

  • ah ok yea that sounds prefect. i did this years ago with some of my gamesalad games before i got into Construct 2.. I was able to do a kind of sprite spawn benchmark during the loading of the game and depending on the score i could control how many particles and other effects would be active to insure the game didn't drag.. worked well.

    Thanks! I'll dig into that. i know scaling canvas could result in making the site unusable in other ways (text becomes too small) but it's still better than what i get when i see it on a 26" screen full screen on an integrated graphics system.. even some older 2gb GPUs seem to be trash when it comes to chrome acceleration.

  • A neat trick about text is if you put it on another layer and enlarge that layer size it doesn't change the size of the text but it does create more definition to a degree where even miniature text is readable and clear just remember to attach the text as a child or pin it or anchor it to maintain it's position.

    The layer you have text on can be larger than the entire project if needed it will just sharpen it up.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • hmmm that is very interesting. i'm not sure it would work in my case, but still the fact that different layers can vary is good to know for the future! :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)