#Twinspire Core - the modern, extensible framework for Kha

1 messages · Page 1 of 1 (latest)

stable gate
#

Twinspire Core was discussed some years ago on the Haxe forums, but I have picked this back up again (and taken a break from Twinspire Web) and added a large amount of stuff to it. It is close to a release, with the aim to get it on haxelib by the end of August.

The changes made to this framework over the past year and a half have been significant. It features a resource manager, animation support, a game event system, extensions to the kha.graphics2.Graphics class, scene management, Dimensions for layouts, and more. It has an internal context system split into two parts: GraphicsContext and UpdateContext. GraphicsContext takes all of your dimensions, render states and performs basic logic and maintains your dim states for you. You can add scrollable containers, which includes infinite scrolling, back buffers and unit measurements. You can also add and render text input regions, with all text input handled by Twinspire, you just simply need to render the state. In UpdateContext, this handles the game event loop, processing your logic and tracking events your listening on for any given dimension.

Unlike most frameworks, Twinspire Core is not designed to be an engine. It's more of a go-between of a low-level framework like Kha, but possessing all the tools of an engine without being too opinionated. The goal is to be flexible enough to give you the power to make any application without the restrictions of a full engine.

To get started, there is a Quick Start guide on GitHub and a CLI to help you get started. Remember that this is based on kha, so if you don't have kha, I'd recommend you install this first. If you're using VS Code, you can also install the kha extension pack.

GitHub

Twinspire Core is a fully managed data-oriented framework written in Haxe. - twinspire/Core

GitHub

Twinspire Core is a fully managed data-oriented framework written in Haxe. - twinspire/Core

stable gate
#

Twinspire Core - the modern, extensible framework for Kha

stable gate
#

Here is a progress report of things happening with Twinspire Core:

  • Updates to the Dimensions API, so you can now build interfaces even quicker using Haxe enums.

Example:

Dimensions.construct(CreateDimAlignScreen(System.windowWidth(), System.windowHeight(), DimAlign(VALIGN_CENTRE, HALIGN_MIDDLE), new FastVector2(), [
            Button.command("Click Me!", "btnClickMe"),
        ], "objectExplorerPane", framePane));

        gtx.addComplex();
        Dimensions.mapToScene(scenes[0]);
        Dimensions.initScene(scenes[0]);

        btnClickMe = Dimensions.findItemByName("objectExplorerPane/btnClickMe");

        Dimensions.resetConstruct();

...

class Button extends SceneObject {

    public function new() {
        super();

        type = IdEntries.button;
    }

    public static function command(text:String, ident:String):DimInitCommand {
        return CreateEmpty([
            MeasureText(text, Theme.instance.font, Theme.instance.fontSize),
            Grow(Theme.instance.padding)
        ], ident, IdEntries.button);
    }

}
  • New EventDispatcher added to organise event handling for Dimensions created in the fashion above.

Current roadmap is to allow binding Dimension Enums to events, creating simple visibility toggles with Haxe macros and assign function callbacks for more complex logic.

Other things on the roadmap includes making sure dimensions generated are correctly assigned to containers, implementing smooth scrolling and finishing up Text Input rendering for a Twinspire 1.0.0 release.

stable gate
#

Okay, so dozens of things have been added since my last post. As it's coming to over a month since I last posted, it's worth I just be brief:

  • Added static, simple animations to GraphicsContext class to allow you to rotate & transform objects continuously. Once implemented, you will also get tweening allowing the application of tint, scale and opacity in addition to the above, for from and to states.
  • Added VectorSpace, which is basically a hyped up API that makes containers look sad. In other words, VectorSpace is superior and you should use it over addContainer and addTextInput.
  • Added an image processor, allowing to modify image buffers to add noise (standard and perlin), clamp, blur and sharpen.
  • Added generic PerlinNoise utility functions.
  • Added a layout system to replace the Dimensions API I was originally working on. Layouts are a more streamlined way to make UI and dimensions using a cleaner API.
  • Added ImageShapeGenerator, designed to allow shape modifications at runtime (not complete yet).
  • Started work on TileMap and a rendering system for it to allow for rendering them and their counterparts (not finished yet), with almost full Tiled format support.
  • Started work on a Camera system which is yet to be implemented.

Other points of contention includes refactoring text input. Ultimately, a 1.0.0 release has been delayed by at least 3-4 weeks. Expect an end of September release.

Ideally, I want Twinspire Core to be usable to create something useful and not a small number of things.

I will also admit I have used AI in some places to assist in generating code for more trivial work, such as the Tiled format and writing the algorithms used in the image processor.

#

Oh, there's also gradient generators in the GraphicsContext class, and now instead of using twinspire.extensions.Graphics2 for extending kha.graphics2.Graphics, prefer the wrapper functions in GraphicsContext which will also handle obtaining your dimensions, animations and transformations automatically.

More information here: https://github.com/twinspire/Core/wiki/GraphicsContext-in-Detail

GitHub

Twinspire Core is a fully managed data-oriented framework written in Haxe. - twinspire/Core

stable gate
#

WIP of something I'm making using Twinspire Core:

  • We have a particle system
  • Editable text box in the corner for no good reason (really just for testing purposes)
  • Shows off 3D rotations
  • Dimension layouts in buttons in the corner and centred title

Roped Strings have also been added and tested. So far, can process 100k characters in ~20ms.

#

As you may also notice, the frame rate is mostly fixed at 60. I've managed to implement a custom rendering pipeline to enable custom frame limiting on the HTML target. Falls back to Kha on native targets using frame buffer frequency variable.

#

A 1.0.0 release of Twinspire Core on haxelib is very imminent. Some things to fix/sort out:

  • Finish off Tile Maps and get them rendering
  • Add collision detection in UpdateContext for sprite rendering
  • Fix up text input and get it fully operational (rich text will probably come later, limited right now to one text format)
  • Cleanup and document everything.

If you're interested in discovering how to get started before release, have a look at the Quick Start Guide.

It's possible some bugs linger coming up to release just due to the sheer volume of features, so if interested, please do consider picking this up and report issues you find while working on something, like a prototype.

GitHub

Twinspire Core is a fully managed data-oriented framework written in Haxe. - twinspire/Core

stable gate
#

Large number of changes have been made since last posted. Getting carried away with UI and implementing some features with UI and layouts.

Currently, there is VerticalBox, HorizontalBox, Stack, and Flow.

Flow is the most complex so far, and works very similar to the CSS Flexbox system.

Like the Template system, it works in a similar fashion. You can build interfaces quickly using this method.

Some bug fixes have happened as well, which includes improving text input and re-implementing dragging. Need to look at re-adding drag constraints, however.