Skip to content

Releases: NotTimTam/ascii.js

Version 1.0.35

15 Oct 22:01

Choose a tag to compare

Core Changes

  • Added wrap property to Menu.Button config that allows the enabling of text-wrapping.
  • Improved the way the Menu class' renderable property is created. Bugs caused by over-sized items are now avoided in most cases.

Additional Changes

  • Added an ascii.js-built tool for viewing the engine's documentation. View it here.
  • Added dataUtils.wrapString() method for automatically adding "\n" to strings to keep them in a specific width.

Migration

No migration steps needed. Fully compatible with v1.0.34.

Full Changelog: v1.0.34...v1.0.35

Version 1.0.34

15 Oct 03:13

Choose a tag to compare

This updated includes rebuilt distributables to correct a versioning issue caused by jsDelivr's CDN indexing a bad version.

Full Changelog: v1.0.32...v1.0.34

Version 1.0.32

15 Oct 03:04

Choose a tag to compare

This update features a single quality of life improvement for the Menu class.

A Menu instance's items array can now be changed after it has been instantiated, meaning the content of the menu can be swapped out in real time.

Migration

No migration steps needed. Update is fully compatible with projects using v1.0.31.

Full Changelog: v1.0.31...v1.0.32

Version 1.0.31

14 Oct 23:49

Choose a tag to compare

This update includes various quality of life improvements and bugfixes.

Core Changes

  • Added forceParentStyles parameter to Runtime config.
  • Simplified Animate behavior and its sub-classes.
  • Improved Menu class to support more user customization.
  • Added onFocus and onBlur callback support to TextInput class.

Additional Changes

  • Updated GitHub actions responsible for distributable creation/deployment.

Migration

When instantiating a new Animate instance, move the second parameter into the config:

new Animate(gameObject, enabledByDefault, config);
// becomes
new Animate(gameObject, { enabledByDefault });

Full Changelog: v1.0.30...v1.0.31

Version 1.0.30

04 Oct 05:27

Choose a tag to compare

This update revamps the Menu GameObject to improve the way users interact with menus. It also fixes several critical bugs caused by webworker implementation in the rendering process.

Core Changes

  • Replaced menu options array in config with an items array. Which should be passed instances of Menu.Item.
  • Added Button, Slider, and Toggle menu items.

Additional Changes

  • The Animate behavior can now automatically overwrite its parent GameObject's renderable property. Simply set the behavior's config.overwriteObjectRenderable value to true. You can run Animate.resetObjectRenderable() to undo this and restore normal function to the object's renderable property.
  • Removed requirement for the current scene to be passed to behaviors.
  • Added positionOnScreen property to the GameObject class, to quickly get its coordinates on the screen, adjusted for parallax and camera position.
  • Replaced Renderer drawFrame method with drawFrames method.
  • Added/updated several examples.
  • Improved web worker implementation in frame generation to fix issue caused by multi-layer web worker rendering.
  • Fixed various other bugs.
  • Updated documentation to reflect these changes.

Migration

  • Replace Menu constructor config.options and config.callback properties with a single config.items property. To replace the original functionality, you can pass constructed Menu.Buttons to this items array. Each Button can be configured with a label, and a callback that triggers what occurs when the option is selected.

Full Changelog: v1.0.29...v1.0.30

Version 1.0.29

02 Oct 02:06

Choose a tag to compare

Among other changes, this update adds much needed Web Worker support!

Core Changes

Canvas 2D context, as opposed to WebGL context, is notoriously inefficient, due to (among other things) its single-thread CPU-only render method. This library was started as an exercise in fully utilizing 2D context despite its inefficiencies.

Web Worker support removes one of the two main inefficiencies of 2D context, single-thread rendering. For now, web workers are only utilized in the Renderers drawFrame method, but this means rendering is entirely decoupled from the game logic stack, freeing up the main thread for the rest of the logic.

Web Workers are enabled by default, but can be disabled by setting the Runtime constructor's config.renderer.useWebWorkers property to false. This is useful if your target platform/browser doesn't support web workers, or you want your application to be compatible with a wider range of devices.

Additional Changes

  • Removed requirement for Behavior constructors to be passed the active scene. They now get the scene from their parent GameObject.
  • Added config.overwriteObjectRenderable property and resetObjectRenderable method to Animate behavior. These allow the management of a GameObject's renderable property by its Animate behavior.
  • Added a tests directory and a webworkers test to demonstrate the new Web Worker support.
  • Updated documentation to reflect these changes.

Migration

  • Remove the scene argument from all Behavior instances and classes. Example:
    • From: new Behavior(scene, gameObject, true)
    • To: new Behavior(gameObject, true)

Full Changelog: v1.0.28...v1.0.29

Version 1.0.28

01 Oct 01:59

Choose a tag to compare

Core Changes

In an effort to prepare ascii.js for web worker support. CommonJS module support has been dropped.

Migration

  • All projects relying on ascii.js will need to restructure to support ES6 modules. See the installation guide for updated instructions on installing ascii.js.

Full Changelog: v1.0.27...v1.0.28

Version 1.0.27

30 Sep 23:17

Choose a tag to compare

This version adds gamepad support to the InputManager, as well as restructures many of its methods to improve input listening.

Core Changes

  • Added an examples directory containing example projects that display mouse, keyboard, and gamepad inputs.
  • Renamed GameObject __onTick methods to onTick.
  • Several InputManager changes/improvements:
    • Added GamepadInterface class for simple gamepad input interaction.
    • Added types, rawGamepads, and gamepads properties to InputManager.
    • Added mouse scroll wheel event detection and handling.
    • Added gamepad event detection and handling.
    • Replaced addOnClick and removeOnClick methods with watchObjectClick and unwatchObjectClick.
    • Added type requirement to addEventListener and removeEventListener, meaning the provided listener methods will only fire on a specific event.

Additional Changes

  • Added isPlainObject method to dataUtils.
    • Utilized isPlainObject method to further validate configuration data passed to various constructors.
  • Added asPixelMesh to Box class that will create the renderable of a Box without creating an actual GameObject in the scene.
  • Several bugfixes, most notably:
    • Revamped PixelMesh and Layer frame generation to properly ignore value-invisible Pixels that are set to visible. In other words, a pixel with no character value, and no background color, does not get added to the frame. This fixes the issue where empty pixels would create black squares over other pixels simply because they were technically "visible."
  • Updated documentation to reflect these changes.
  • Removed Pixel instance width and height properties. Since Pixels are always 1x1.
  • Added post-construction origin modification to Pixels and PixelMeshs through origin getter/setter.
  • Added pixels property to PixelMesh.
  • Added setColor, setFontWeight, setBackgroundColor, setSolid, and fromString methods to PixelMesh class.
  • Removed filterThis method from GameObject class.
  • Replaced InputManager __clickListeners array with __gameObjectClicks.
  • Added window blur handling to InputManager.

Migration

  • Replace all GameObject (and classes that extend them) __onTick methods with onTick. Functionality remains the same.
  • InputManager:
    • Use watchObjectClick and unwatchObjectClick instead of addOnClick and removeOnClick methods. Instead of passing a GameObject as the first parameter, pass the GameObject instance's id property.
    • In ALL addEventListener and removeEventListener calls: Unless you want to watch a specific event type (permitted types: InputManager.types), add an "all" string argument before your listener method to continue listening to all events with that method.
  • Replace all Pixel.width and Pixel.height calls with 1.
  • Remove all uses of GameObject.filterThis() method.

Full Changelog: v1.0.26...v1.0.27

Version 1.0.26

28 Sep 06:03

Choose a tag to compare

Core Changes

  • Added layer argument to GameObject constructor. Increasing the efficiency of adding object instances to a Layer.
  • Made LayerManager a property of Scene instead of Renderer.
  • Reverted a change and made the Renderer instance a property of the Runtime instance again.

Additional Changes

  • Replaced runtime property on Core instances with a getter.
  • Removed runtime property from InputManager and Layer instances.
  • Removed scene property from Layer instances.
  • Updated documentation to reflect these changes.
  • Removed unnecessary code from Camera class and decoupled it from the GameObject class.

Migration

  • Replace all references to InputManager.runtime with InputManager.scene.runtime.
  • Replace all references to Layer.runtime with Layer.layerManager.scene.runtime.
  • Replace all references to Renderer.layerManager with Scene.layerManager.

Full Changelog: v1.0.25...v1.0.26

Version 1.0.25

27 Sep 02:07

Choose a tag to compare

Core Changes

  • Added Layer instance visible attribute getter and setter. GameObjects in an invisible layer will be invisible by proxy.
  • Added visibleLayers attribute to LayerManager class. This will return an array of the Layers associated with this LayerManager whose visible attribute is true.

Migration

Drop-in-place update. No breaking changes to previous version.

Full Changelog: v1.0.24...v1.0.25