Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] HTML 5 window size / controller detection

Author
Message
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 25th May 2021 13:43
Hi,

I have created a game and it is pretty much done. Unfortunately (and understandably) most players won't go through the steps to download my game, so play in browser would be preferable. The HTML 5 export works fine and I have hosted the game on itch.io for a couple of tests. Two things failed leading to these questions:

- how to manage window size / scaling in HTML 5?
- how to detect gamepads?

I don't get it to play in fullscreen or scale correctly. I set a virtual resolution of 240x135 (SetVirtualResolution) and scale up to 1920x1080 (SetWindowSize) on Windows machines (it's a retro game). In HTML 5, if I click on the "Toggle Fullscreen" button it's running in fullscreen, but the actual window only takes up 240x135 (see screenshot). If I set code the window size to be fullscreen, it doesn't work either. What would be the correct way to set up the window size for HTML 5 (hosted on itch.io)?

I use the CompleteRawJoystickDetection() to check for gamepads and use them (it's a two player coop game). Again, this works fine on the Windows export, but fails to detect on the HTML 5 build. Do I need to use something else, or does this command simply not work with HTML 5?

Solving the first question is more important, since I've implemented backup keyboard controls, which work fine.

Thanks so much for any input.

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

codesurge
8
Years of Service
User Offline
Joined: 18th Oct 2015
Location:
Posted: 25th May 2021 19:31
This post has been marked by the post author as the answer.
I have myself bug:
https://forum.thegamecreators.com/thread/227617
HTML export with AppGameKit Classic works
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 26th May 2021 11:19
You are right, I can confirm that the export with AppGameKit Classic works as intended. That solves the first bit of my problem.

Does anybody know how to get it to detect controllers in HTML 5?
codesurge
8
Years of Service
User Offline
Joined: 18th Oct 2015
Location:
Posted: 26th May 2021 16:24 Edited at: 26th May 2021 16:27
CompleteRawJoystickDetection () does not work here in html5 either.
https://github.com/TheGameCreators/AGK-Studio/issues/810
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 26th May 2021 21:20
Oh wow, that's a shame. Thanks for testing!
codesurge
8
Years of Service
User Offline
Joined: 18th Oct 2015
Location:
Posted: 4th Jun 2021 18:16
Simple joystick commands work in html5 :

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Jun 2021 19:57 Edited at: 4th Jun 2021 20:04
Quote: "Simple joystick commands work in html5"

using actual joystick/gamepad? or, do you mean emulated/WASD?
it's not detecting my gamepad here (Classic and Studio exports).

(same with raw)
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 5th Jun 2021 14:40
My gamepads aren't detected either in Virtual Nomad's example. I want to use the raw commands for my project, not the emulated joysticks.
codesurge
8
Years of Service
User Offline
Joined: 18th Oct 2015
Location:
Posted: 5th Jun 2021 19:10
I made an example with AppGameKit Classic
Works with an xbox joystick
http://marcus.zone.free.fr/j/testjoystick.html



codesurge
8
Years of Service
User Offline
Joined: 18th Oct 2015
Location:
Posted: 5th Jun 2021 19:21 Edited at: 5th Jun 2021 19:22
Virtual Nomad : here the xbox joystick works with your program

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 5th Jun 2021 20:08
doesnt work with my logitech. will try with an xbox controller when i come across one
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
codesurge
8
Years of Service
User Offline
Joined: 18th Oct 2015
Location:
Posted: 6th Jun 2021 06:27
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 6th Jun 2021 08:25 Edited at: 6th Jun 2021 08:30
are you using a process like
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 6th Jun 2021 20:53
Yes, I call CompleteRawJoystickDetection in my game beforehand.

Didn't check codesurge's example yet, will do.

Login to post a reply

Server time is: 2024-04-27 02:45:23
Your offset time is: 2024-04-27 02:45:23