I (Yanrishatum) see too many same questions. They irritate me.
Translation
"How dare you come into this chat and not realize that i am the GOD of heaps and that you MUST check out MY documentation1!!! Im veyr abngrey!!!" - translation from someone in chat.
Very accurate, I highly approve.
27/03/20: Added extended FAQ.
20/06/20: Altered window resizing info (suggested by TitForTat#1234 ).
23/06/20: [FAQ2] Added help about HIDE prefab loading. (Thanks TitForTat#1234 and jefvel#3150 )
29/10/21: Removed outdated questions (4.2 haxe crash/2d camera), updated some questions, added some questions, added Official™ translation of what header statement actually means. Very accurate.
Q: I've just installed Heaps 1.8.0 (or whatever haxelib version is right now) and don't see features people talk about in chat!
A: Use git heaps. It's pretty stable. You can do that with haxelib git heaps https://github.com/HeapsIO/heaps.git
. Note that new versions of Heaps do not support Haxe3, and require Haxe4.
A: No. Heaps does not support any of those backends. Only Hashlink (+HLC), HTML5 and flash are supported.
Q: But it says on Heaps.io that I can publish on all major platforms!
A: Yes, you can, by using HLC. But it won't be a smooth sailing if it's not HTML5 or desktop. Hit up Heaps devs for console backends with proofs of having SDK license, and for mobile see below.
A: In theory. There's no established pipeline to do so, and if someone succeeded - he didn't really share it with community. You can find outdated project files for android here
A: Use Hashlink to generate C source code, then proceed with compiling it with your compiler of choice. Here is a separate guide on compilation and alternative approaches: How to compile HL/C
For reference: Northgard and Darskburg bundle bytecode version with VM, and HL/C used only for consoles.
A: Heaps does not come with update loop for objects, it's up to you to implement it. Closest thing to update
is sync
, which you shouldn't treat as such - it should be used to sync data such as position matrix and other parameters that are used for rendering. There is an update
method in hxd.App
.
A: Heaps does not come with a physics simulation nor collision detection system. It's primarily focuses on rendering. There are very basic collision classes in h2d.col
and h3d.col
, but by default they are used for hit-testing against mouse. There are physics and collision detection libraries on haxelib. For example nape, differ, echo
A: Deal with it. Practically nobody contributes to documentation. There is some. There also samples in samples (duh) folder (also see question below regarding more samples). You're always welcome to provide documentation on things. ¯\_(ツ)_/¯
A: It's because you used Res.initEmbed
. As name suggests, it embeds all resources into the code/binary. On JS it results in base64-encoded files as raw strings in JS file. For JS it's recommended to use pak file system or implement your own FS
A: See Resource Management in docs.
A: MP3 in Res is specifically disabled on Hashlink due to it being inferior to OGG. However if you use it for whatever reason, you can enable it with -D heaps_enable_hl_mp3
in hxml file. It is still possible to load and play MP3 files on HL without enabling them in Res. Do it via hxd.Res.load
method.
A: Due to the fact that not all browsers are capable of playing .ogg files (hello Apple), Heaps does not use native ogg decoder, hence does not support ogg files on JS unless you add stb_ogg_sound
library.
A: At compile time, use following -D
flags:
-D windowTitle=My Fancy Title
-D windowSize=800x600
At runtime:
@:privateAccess hxd.Window.getInstance().title = "My Fancy Title";
hxd.Window.getInstance().resize(800, 600);
// With `@:privateAccess` it's possible to access underlying Window instance
// This works only on DirectX or SDL
var win = @:privateAccess hxd.Window.getInstance().window;
win.center(); // Relocate window to center of the screen.
win.setMinSize(400, 300); // Set minimum possible size of the window.
win.setMaxSize(1024, 768); // Set maximum possible size of the window.
// It's also possible to modify window position and sizing separately trough it's poroperties.
A: This is due to high DPI support not being fully implemented, as well as old version of SDL being used. Current solution is to manually build HLSDL with newer SDL binaries, as it seem to fix it. See this comment for fix instructions.
A: Report it here
A: Report it here but most likely you won't get it. Also maybe worth discussing it in discord channel.
A: Tune in to #Heaps channel in Haxe discord, it's the most active place. You also can try forums, but it's a wild card.
When asking a question about issue you have, please specify the following:
- Which target: HTML5, SDL or DirectX
- Specifically note if you are on high-DPI monitor.
- Which scene you are using: s2d or s3d
- In case of s3d - which material setup: Forward (default) or PBR
This will help a lot when trying to understand what problem you have, as we won't have to torture you for information if it's s2d or s3d on problems like "Collisions don't work properly", or realize that you have a DPI bug when your scene is rendered incorrectly.
A: Obviously a samples folder. There also full game samples page in documentation. You also can check out pinned messages in #Heaps channel on discord, there were some too.
Update 27/02/20: Keep an eye on DeepNight's tutorials section on his website, as he plans to write at least a few getting started tutorials.
Update: 29/10/21: There's also a fairly old samples by Beeblerox. Not that they are outdated on a number of occasions, like camera sample, but still should give you a good showcase about various elements.
A: Its own language - HXSL, which then compile into either GLSL or HLSL. It has a lot of limitations and peculiarities, so here's a cheat sheet about for shaders.
A: No.
A: No, but Cannasse works on Vulkan backend in his free time.
A: Yes.
- See DeepNight's gameBase and deepnightLibs.
- His LDtk also have support for heaps.
- My Heeps library.
- Consider using HIDE. But you're on your own in that regard, as barely anyone knows how to use it. There are nightly builds available.
- Also check out CastleDB (HIDE have it built-in)
- Found something else? Ping me up in Discord.
I'd like to know how you've been using pak with JS, it appears JS support in the pak format is "TODO"