[questions] about Vector types and more

flashjaysan

New member
Joined
Oct 13, 2021
Messages
4
Hi!
I come from BlitzMax and I still need to find my way around Cerberus X. My main interest is in HTML export support.
The sample folder is a mess for new users. Is there a place where I could find progressively difficult projects that I would be able to learn from (and of course, subjectively ordered, not simply in a folder with no idea where to start from)?
Does Cerberus X provide vector types like Vector2 and Vector3?
Is the SuperStrict mode supported?
How works the HTML export? It converts native code to webassembly or does it build a native HTML5/WebGL project?
Finally, is there a Discord server for Cerberus X users?
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
878
I'm not sure about what level of vector is supported without any addons. I have a few addon-libraries but have not tried them yet so I can't answer that.

The HTML export is amazing and more slim and effecient compared to WebAssembly code produced using Emscripten with comparable languages such as Monkey2 / Wonkey. It's amazingly efficient and what I understood Cerberus actually does this by itself and JS is the only language it handles inside itself without any external transpilers. You'll get GPU-accelerated WebGL code when you use Mojo2 if you explicitly don't use the Canvas directive. So there is a choice for you how you want that your graphics should be produced.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,135
The next release will have 2d vectors. You can get the module already from github. As we don't have a 3d module, there is no 3dvector module from us. But there are add-ons like minib3d and Vortex who ship with one.

Jimmy answered about HTML so no need to answer that.

Thank god others were able to figure out how things work with this "shitty mess" of examples. But to answer your question, no there isn't. see Jimmy's answer below.

There is no Superstrict, or you would have it found on the documentation. Only Strict.

There is no official Discord channel for various reasons.

Why don't you try Blitzmax NG or Wonkey, sounds like they would be the perfect fit for you. I heard they have 3d vectors, HTML export via emscripten and a great Discord channel.
 
Last edited:

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
878
For examples there are always Pakz collection. You have to rename all files to .cxs of course but the code works 100%.

Mind you that these mostly use Mojo1 (so only canvas in HTML) but they show the language concepts with an increasing level. You can always change these examples into Mojo2 later if you care to use any or want to check the true performance you could get from them. But my suggestion is to leave them as Mojo1 and not let that bother you just yet, and just use them for learning concepts.

 

flashjaysan

New member
Joined
Oct 13, 2021
Messages
4
OK, so to recap:
- Examples are there but not ordered as teaching material but more as a pick your poison demos projects. But there is a Pakz (don't know if it's a user name or something else. Any link?) collection that could help learn the tool. Thanks for the Flash examples link. By the way, I never said that examples were a shitty mess. You added that up!
- The HTML export is done through Canvas 2D API in Mojo and through WebGL in Mojo2 by default. Is Mojo2 similar to Mojo or is it way more difficult to learn? Do I have to tinker with low level stuff like OpenGL and things like that?
- Future releases of Cerberus X will provide a Vector2 type. Great news!
- No Vector3 nor 3D capabilities are provided in Cerberus X. I don't mind.
-
No SuperStrict mode. Sad.
- No Discord. Sad. I guess I'll have to bear with the asynchronous nature of forum.
- Try BlitzMax NG. Yes. I already tried it and I pretty loved it. When I said I came from BlitzMax, I was implying that it was NG (and it's only been a week). Sorry. The one thing missing in BlitzMax that interests me most from Cerberus is its HTML export. I'm still in the phase of trying things out to decide which tool to select balancing ease of use and features.
- Try Wonkey. I took a look but it seems too early to adopt this tool. And if I have the choice, I'd go with a WebGL/Canvas export than a emscripten one.

Is there a feature to get the console input from the user? Like:
Local answer: String = input("What is your quest?")


I'll ask more questions as they come. Thanks for the answers. It seems the Cerberus X community is tiny but supportive. Kudos guys!
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
878
Mojo2 is as easy as Mojo1 it's mostly about the syntax, 99% of the time it means that you simply add a canvasname and a dot in front of the command and this is because mojo2 always want to know what canvas you want the command to act on. Mojo1 assume the one canvas it has. The clear command will have a different spelling but that's how different it gets.

You need to manually do a few things in Mojo2 that's hidden in Mojo1; you have to create and flush the canvas so this means that there will always be 3-4 more instructions. But that's pretty much it, It's that simple and adds niceties such as shaders and the ability to draw canvas onto other canvases.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,135
Pakz is a username of a guy who once was active on the Monkey X board.

You can retrieve keyboard input via the GetChar command.
 
Top Bottom