Author Topic: 123 basic - HTML5 for GLBasic  (Read 121167 times)

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
Nice to hear! I did no tests on iOS (do not own a device) and Android was also quite untested (but as I can see Touch, Screen adjustment and Sound does not work yet properly, which will be fixed soon).
That's no Bug, that's my project!

http://programming-with-design.at/

MrTAToad

  • Guest
The web compiling is starting to work well.  The loading/save bits do need to be implemented (as well as being able to paste text).

The only thing missing is INLINE/ENDINLINE - I get a compiler error for those - does the offline version support that ?

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
INLINE / ENDINLINE will never work. This is compiled directly to JS+HTML5, no C++ compiler is involved. I personally consider injecting "foreign code" into a language via syntax elements like "INLINE / ENDINLINE" as bad code, because it hinders the language itself and causes lots of problems, especially in regards to compability and encapsulation. This is something I want to avoid as much as possible.

Saving/Loading in the IDE is currently done in localStorage, when compiling source code, which is a temporary solution. Pasting text should work though.
That's no Bug, that's my project!

http://programming-with-design.at/

MrTAToad

  • Guest
Yes, got copying and pasting to work now - odd it didn't before...

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1793
    • View Profile
    • Homepage
Great news that you continue with this project! Does network socket commands work?

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
No, the socket commands do not work yet.
That's no Bug, that's my project!

http://programming-with-design.at/

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1793
    • View Profile
    • Homepage
Is it possible to ever get them to work in html5?

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
Theoretically WebSockets are a thing that most current browsers support. I personally already have written an application with WebSockets and I have quite some experience with them. I do not know for sure if it is possible to emulate all the NET... / SOCK... commands of GLB with them, because you do need a server inbetween connections.

How I'll implement them, I am not sure yet, as these features (like 3D) are very far in the future. Getting the current state bugfree and usable is a challenging job, that will surely take some time.


btw: I moved my todo list from a local file to GitHub. So you always know which bugs/enhancements/... I'm going to work on in future.
That's no Bug, that's my project!

http://programming-with-design.at/

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 382
  • to program what I have do how should programming?
    • View Profile
@Coolo:

First of all thank you for sharing your program 123Basic.
I tried to compile something but I found it difficult to do so.

1) On line can not compile applications that have files in the Media folder (fonts jpg, etc.)
2) Locally instead I can not properly set the macro and compile everything.

Could you explain in more detail how to proceed in both cases?

Ciao
Qedo


Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
hi!

1) To get you assets online (sound, sprites, ...), go to the "Asset" tab on the top and drag'n drop your files.
2) Download the data from github, then compile 123basic with GLB (open die gbap file).
Code: (glbasic) [Select]
::Compile to HTML5 via 123basic
set OTTBASIC_PATH=C:\Users\Robert\Documents\GitHub\123-basic\123basic.app
"%OTTBASIC_PATH%\123basic.exe" -N\"%GLB_PROJ_NAME%.gbap\"" -P\"%GLB_PROJ_PATH%\\\"-G"HTML5"
Adjust the OTTBASIC_PATH to the directory where the compiled EXE of 123basic is. Then copy the Macro to the macro you desire (Tools -> Macros -> Edit -> Blue for example). Now you should be able to compile your GLB project from the IDE with 123basic.
That's no Bug, that's my project!

http://programming-with-design.at/

MrTAToad

  • Guest
It does have some interesting problems with Android's Chrome browser and default settings - it seems to work, except for text : There is none (or you just get one line).  Using the "Get desktop version" does seem to solve it though

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
Yes this problem has been fixed, but not all demos were recompiled. Try the "JumpIt" demo, that one has been recompiled. I'm currently trying to automate uploading new demos onto the server, so i do not have to do this manually everytime I fix something.
That's no Bug, that's my project!

http://programming-with-design.at/

MrTAToad

  • Guest
I'll try that!

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 382
  • to program what I have do how should programming?
    • View Profile
Coolo, Thanks for the explanation.

I did some tests and 123basic has compiled for all programs except for the app whose gbap have encoding = "utf-8"
For these apps, including FontTest, which is among those tested, when compiling locally with the macro I get the following error:

XML Error - Expecting '<'


I seem to have overcome this problem by loading the gbap with Texpad (a text Exitor) and resaving always with the "utf-8".
After i can also compile FontTest.
But in a my program, even after having the procedure declared before does not work (see screenshot, on the left 123basic, on the right HTML5 of GLB).
It seems that the fonts are not loaded from the "Media" folder even if the server messages apparently appears so.

Any idea?
thanks
Ciao
Qedo

messages from the server:

123basicServer active and listening on port 421337
1> HTTP Server active and listening on port 53664
1:1> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/123File.html (200 OK)
1:1> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/123Script.js (200 OK)
1:1> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/DIR_STRUCTURE (200 OK)
1:1> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/Media/smalfont.png (200 OK)
1:2> 404 Not Found: D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/favicon.ico
1:1> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/Media/35_56_ARIAL_BOLD_ROSSO.png (200 OK)
1:2> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/Media/35_56_ARIAL_BOLD_BIANCO.png (200 OK)
1:3> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/Media/35_56_ARIAL_BOLD_BLUE.png (200 OK)
1:4> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/Media/35_56_ARIAL_BOLD_ARANCIO.png (200 OK)
1:5> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/Media/10_16_ARIAL_BOLD_BIANCO.png (200 OK)
1:2> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/Media/14_22_ARIAL_BOLD_BIANCO.png (200 OK)
1:1> GET D:/appoggio/basic/glbasic12/ETA_HTML5_123/ETA.app/Media/MaleRoadStd2010.csv.123SCRIPT_DATA (200 OK)
1:6> Close!

Offline metzzo

  • Mr. Polyvector
  • ***
  • Posts: 140
  • Coolo ist cool!
    • View Profile
    • programming with design
Hey!
Thanks for the bug report. I've been hunting the bug down and the origin for this problem was that the engine messed around if two fonts were loaded (smalfont.png is always implicitly loaded) - causing the second one not being displayed. Then there was also an issue with the character height of the fonts). This is now fixed.

Your issue with loading gbap files is weird though, I do not encounter any of these problems. Would it be possible if you would send me an example.

Here is the changelog since last changelog:
Code: (glbasic) [Select]
Changed: All "GLBasicScript" / "GLBScript" / "GLB" renamed to 123basic/OTT
Changed: Tested all samples in Firefox/Chrome/Opera/Safari (latest versions) and created issues for stuff that didnt work
Fixed: Touch on mobile browsers working again
Fixed: Font rendering on mobile platforms
Fixed: Firefox supports PLAYMUSIC
Fixed: SETSCREEN works again
Fixed: LOCAL sx, sy; GETDESKTOPSIZE sx, sy; SETSCREEN sx, sy, FALSE // no ugly scroll bar is visible
Fixed: ALPHABLEND 0 really resets alphablending
Changed: Made some tests ready for mobile (resolution is set according to DESKTOPSIZE): JumpIt, IsometricDemo (still very slow), JumpFrog, ...
Fixed: PRINT ignores unknown characters (0-26 charcode)
Fixed: SPRITE2MEM had wrong color format (ARGB instead of ABGR)
Fixed: CALLBYNAME rewritten and returns correct return value
Changed: Optimized Shadow Stack implementation in Debugging mode - should run now much faster
Fixed: SETSCREEN Fullscreen parameter functions now (does not use the HTML5 fullscreen API anymore, because it requires to be callen in a click/key event, which SETSCREEN is usually not -> sets the canvas size to innerWidth/innerHeight instead)
Added: IE 11 support
Added: Automatic test compilation and upload
Added: Audio system rewrite, uses now additionally Web Audio as playing Backend
Added: New demo (ParticleSystem)
Fixed: Multiple LOADFONT did not work
Fixed: Character height of some fonts was not set properly
Fixed: MUSICVOLUME works with new sound system
That's no Bug, that's my project!

http://programming-with-design.at/