October 17, 2021, 08:43:26

Author Topic: HTML5 Window Size  (Read 387 times)

Offline hosch

  • Full Member
  • ***
  • Posts: 122
HTML5 Window Size
« on: May 19, 2021, 11:02:49 »
Hi,

first time trying to get something to work in HTML 5. I was wondering how to get my game to scale correctly in HTML 5 using AGK. When I upload it to itch.io, the window size doesn't seem to match at all what I have specified in the code. When I switch to full screen, it uses the virtual resolution and not the window size specified in my file, for example.

It is a retro game in a gameboy style, so I am using 240x135 px for my virtual resolution and scale up to 1920x1080 px for the window size.

I've tried
Code: [Select]

SetWindowSize(screenX,screenY,fullscreen)
SetVirtualResolution(resX,resY)

and

Code: [Select]
SetWindowSize(GetDeviceWidth(),GetDeviceHeight(),fullscreen)
SetVirtualResolution(resX,resY)

both results don't work. What would be the correct approach? Thanks in advance!

Oh, and it doesn't seem to detect any connected gamepads either ??? (working fine in my Windows build). Does anyone have any experience getting this to work as well?
« Last Edit: May 19, 2021, 11:13:30 by hosch »

Offline hosch

  • Full Member
  • ***
  • Posts: 122
Re: HTML5 Window Size
« Reply #1 on: May 26, 2021, 11:18:00 »
I have a little update on this. Apparently I did nothing wrong, there seems to be an issue with the HTML export on AGK Studio. The export from AGK Classic works as intended.

My gamepads are still not detected, though  :))

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 814
  • Bonjour
Re: HTML5 Window Size
« Reply #2 on: May 26, 2021, 15:36:39 »
That is good to know Maybe now you have reported it it will be on their list of fixes. I've never used the HTML5 export so far but it might be of use at some time . Happy programming . 
 
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen.

Offline hosch

  • Full Member
  • ***
  • Posts: 122
Re: HTML5 Window Size
« Reply #3 on: May 26, 2021, 16:05:58 »
An issue has been created on their github, yes.

The HTML 5 export is surprisingly straightforward. Two things you should keep in mind are that the usual file system stuff doesn't apply (for savegames and so on) and, more importantly, do not use SetSyncRate, it slows down the whole program! Use SetVsync for HTML 5.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal