Skip to content

c-g-dev/cgd-heaps

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6,735 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c-g-dev heaps.io fork

Scoped Resource Loading

One of the biggest issues with heaps.io is that you cannot easily import components that have their own local resources. I have already addressed this in my heaps-local-res repo, but that necessitates a change in resource access syntax.

With this repo you can keep the same normal resource access syntax like:

var img = hxd.Res.myImg.toTile();

BUT individual folders/packages can have their own /res folders. The /res folder that is used by a class is mapped to the lowest /res folder in its filetree path.

This requires a full overhaul of the internals of the heaps.io Resource system and cannot easily be ported to its own library. Thus a fork of heaps.io is necessary.

Object .update() system

Heaps.io objects can only do on-frame processing via sync(). In this fork, Objects now have a dedicated .update() method that is called every frame. If an object is disabled, then the update() of its children is not called. The Scene is the root of all update() calls.

Preview CLI

You can launch a quick preview window for an h2d.Object class from a project that depends on this library:

cgdheaps preview <module>

Examples:

cgdheaps preview cgd.debug.TelemetryView
cgdheaps preview TelemetryView

Install the cgdheaps command:

bash scripts/install-cli.sh

On Windows:

scripts\install-cli.cmd

How module launch works

  • If the target class defines static function __launch__(app:hxd.App):Void, the preview runner calls it and skips automatic instantiation.
  • Otherwise the runner uses constructor fallback:
    • required constructor args are passed as null
    • optional constructor args are omitted
  • If the created object has no parent, it is automatically added to app.s2d.

Debug Server

heaps-debug-server baked in, with better support since this is a fork we have full control over. By setting -D cgd_debug you can make it automatically attach with no code changes.

Baked in Control System

Codified the deepnightlibs controller system (with some modifications) directly into the heaps framework.

Planned features

  • Fix the Graphics line rendering (heaps.io has had open PRs for years that fix these issues but they never get merged)
  • More componentizing support (once the hotloading feature of the -hl target comes out in the next hashlink release, heaps componitization will be blown open and largely solved)

About

biting the bullet and forking heaps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Haxe 99.1%
  • Other 0.9%