Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Frame rate problem 120 fps
Started by sunnylord53 Aug 07 2019 10:33 PM

- - - - -
2 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sunnylord53

[GLOBAL: userInfoPane.html]
sunnylord53
  • Observer

  • 1 posts
  • Corona SDK

Hello,

 

I've played a bit with the html 5 exporter and I realised that my exported game is 2x faster on my 120 Hz screen when played in a browser as if the key in config.lua fps = 60 was ignored during the build. What should I change to keep the function onEnterFrame processing 60 times per second even on a 120 fps screen?

 

thanks

iosman



[TOPIC: post.html]
#2

TeNoR

[GLOBAL: userInfoPane.html]
TeNoR
  • Observer

  • 3 posts
  • Corona SDK

Unfortunately each browser has own HTML5 settings: different real FPS, default fonts, etc.

 

For example HTML5 on Chrome works faster than Firefox.

 

You can use JS callbacks to determine browser or real FPS and use this value for enterFrame settings.

 

Simple code (main.lua):

local function callbackFunction( message )
print(message); -- you get browser name
end

local platform = system.getInfo("platform")
if platform == 'html5' then
info.callback = callbackFunction
info.execute()
end
 
and JS file (info.js):
info = {
    execute: function() { 


if (sUsrAg.indexOf("Firefox") > -1) {
     sBrowser = "Mozilla Firefox";
     //"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0"
} else if (sUsrAg.indexOf("Opera") > -1) {
     sBrowser = "Opera";
} else if (sUsrAg.indexOf("Trident") > -1) {
     sBrowser = "Microsoft Internet Explorer";
     //"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; Zoom 3.6.0; wbx 1.0.0; rv:11.0) like Gecko"
} else if (sUsrAg.indexOf("Edge") > -1) {
     sBrowser = "Microsoft Edge";
     //"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299"
} else if (sUsrAg.indexOf("Chrome") > -1) {
    sBrowser = "Google Chrome or Chromium";
    //"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.181 Chrome/66.0.3359.181 Safari/537.36"
} else if (sUsrAg.indexOf("Safari") > -1) {
    sBrowser = "Apple Safari";
    //"Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1 980x1306"
} else {
    sBrowser = "unknown";
}


this.callback( sBrowser );


    }
}


[TOPIC: post.html]
#3

ponywolf

[GLOBAL: userInfoPane.html]
ponywolf
  • Contributor

  • 273 posts
  • Corona SDK

We should add this into the base HTML template...




[topic_controls]
[/topic_controls]