Author Topic: Steam HTML5 Compiler  (Read 1716 times)

Offline loftcat

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
    • Loftcat Software
Re: Steam HTML5 Compiler
« Reply #15 on: 2022-Sep-24 »
about the local web server not working but are you sure you have python installed?
To check this, open a cmd and run python.exe

Aha! Installed Python and it works  :booze:
So simple when you know how. I'm going to do a little getting started guide for sure!

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 389
  • to program what I have do how should programming?
    • View Profile
Re: Steam HTML5 Compiler
« Reply #16 on: 2022-Sep-24 »
we never think about simple things :D
« Last Edit: 2022-Sep-24 by Qedo »

Offline loftcat

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
    • Loftcat Software
Re: Steam HTML5 Compiler
« Reply #17 on: 2022-Sep-26 »
First cut of some steps for another GLBASIC-HTML5 newbie like myself...  what do you think? Anything to add or amend ?

GLBASIC v16 (Steam edition) - Getting started with the HTML Compiler (Windows 10)

Pre-requisites: GLBASIC v16 Steam Edition

1. Purchase the HTML Compiler from Steam as GLBASIC DLC. Once purchased, the HTML Compiler should automatically install via Steam.
There isn't an obvious change to GLBASIC when you launch it, but under Project->Options on the menu, HTML5 and HTML5-webGL options should be available.

2. Install Python. This is not mandatory for the compiler to work, but is needed if you want to test your compiled html5 program in the simplest way. You can install the latest version of Python from the Microsoft App Store.

3. Create a new project with the following code:

SETLOOPSUB "MainLoop1"
SUB MainLoop1:
   PRINT "Hello World",10,10
   SHOWSCREEN
ENDSUB

The key thing is a SETLOOPSUB should be used for main loops when compiling to HTML5.

4. On the menu go to Project->Options and set Platform Configuration to 'HTML5-WebGL' and click OK.

5. Go to Compile->Build Multiplatform. Click on HTML5-WebGL to compile your project.

6. Locate your project folder in your GLBasic home folder. Navigate to the ..\<projectName>.app sub-folder of your project. If there isn't a Media folder, create one. Inside your Media folder, if you do not have any files, create a simple dummy text file. It doesn't matter what it is called, as long as a file exists here.

7. Go to Compile->Build Multiplatform. Click on HTML5-WebGL to re-compile your project

8. Navigate to the ..\distribute\HTML5 folder and you should see several files of these types: .data, .html, .js, .wasm and .bat. Providing you have installed Python in step 2, you should be able to click on the run_local_test.bat file to run your project in a browser using a local web server.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4453
    • View Profile
    • FUED
Re: Steam HTML5 Compiler
« Reply #18 on: 2022-Sep-27 »
Thanks for the heads up, I will sure be trying web compile this year and this will help.

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 455
    • View Profile
    • my personal website
Re: Steam HTML5 Compiler
« Reply #19 on: 2022-Oct-02 »
I completely forgot about Python requirement, but wasn't it included with older (v14 / v15) instllation of html5 target, hm not sure about that. Any specific Python version is required, like 2.x or newer 3.x?
Good job for testing this, few new question comes to my mind, for example what about simple OpenGL inline like glTranslate etc, will something like that work in WebGL?
It would be great to see additional platforms as such DLC, Linux should be first.
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 389
  • to program what I have do how should programming?
    • View Profile
Re: Steam HTML5 Compiler
« Reply #20 on: 2022-Oct-03 »
it seems so, see https://www.glbasic.com/forum/index.php?topic=6569.msg52954#msg52954
I tried to compile Opengl.bas and compile it though the result does not seem correct to me
My Python version is 3.8.3
« Last Edit: 2022-Oct-04 by Qedo »

Offline loftcat

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
    • Loftcat Software
Re: Steam HTML5 Compiler
« Reply #21 on: 2022-Oct-07 »
My Python version is 3.10.7

Offline svenart

  • Mr. Drawsprite
  • **
  • Posts: 54
    • View Profile
Re: Steam HTML5 Compiler
« Reply #22 on: 2022-Oct-15 »
hey everyone. I just have bought steam glbasic and the html5 compiler and got very frustrated because it was not working "right from the start". However, after reading this thread I followed the instructions and now my first game runs almost perfectly in a browser yiehhhaaa.....

Only 2 problems are there right now.

1. The right mouse button is not working :( Is there a way to fix this?
2. it seems that getscreensize is not working correct.

However, can´t wait now to finish a first working demo for browser and upload it on Itch.IO or my own website. Great!

Offline svenart

  • Mr. Drawsprite
  • **
  • Posts: 54
    • View Profile
Re: Steam HTML5 Compiler
« Reply #23 on: 2022-Oct-15 »
Tried to compile 4 of my 4 games for html5, 1 of them worked fine without much changes needed.  =D

Uploaded a first version for testing on Itch.io.

My most important question now: How can I get rid of this annoying blue menu in the bottom area?

When using playsound, the volume seems not to. Samples will always be played at 100% volume.


Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10859
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Steam HTML5 Compiler
« Reply #24 on: 2022-Oct-16 »
The blue menu is in the template html page. I have to check the volume thing.

Offline hardyx

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 505
    • View Profile
Re: Steam HTML5 Compiler
« Reply #25 on: 2022-Nov-02 »
...
Good guide for GLB HTML5, is good to know all this things.
You can download Python in the offlicial page too, but I think in MS Store is easier for begginers.
https://www.python.org/downloads

Offline svenart

  • Mr. Drawsprite
  • **
  • Posts: 54
    • View Profile
Re: Steam HTML5 Compiler
« Reply #26 on: 2023-Jan-05 »
Is there any hope to get a solution for the mouseproblem in html5?

Tried everything but can´t get it to work

- Mouseposition is only available when button is clicked. (no mouseover effects)
- Mousbutton 2 is not working
- mousewheel (button3) is not working
- also input and some keys are not working as they should.

Honestly, this html5 compiler is quite useless without proper mouse and keyboard controls. Please, PLEASSSE fix it.

Offline loftcat

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
    • Loftcat Software
Re: Steam HTML5 Compiler
« Reply #27 on: 2023-Jan-09 »
Hope we see some improvements too. An updated HTML version of GLBASIC will really help extend it's life and make it worth purchasing on Steam.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10859
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Steam HTML5 Compiler
« Reply #28 on: 2023-Jan-09 »
I'll try to update the HTML5 libraries. Did you try the "fulscreen" option and/or the MOUSEAXIS instead MOUSESTATE?

Offline svenart

  • Mr. Drawsprite
  • **
  • Posts: 54
    • View Profile
Re: Steam HTML5 Compiler
« Reply #29 on: 2023-Jan-10 »
I tried Mousestate but it is not working. My HTML Games are all running in window mode, have not tried fullscreen.