Releases: NotTimTam/ascii.js
Version 1.0.35
Core Changes
- Added
wrapproperty toMenu.Buttonconfig that allows the enabling of text-wrapping. - Improved the way the
Menuclass'renderableproperty 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
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
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
This update includes various quality of life improvements and bugfixes.
Core Changes
- Added
forceParentStylesparameter toRuntimeconfig. - Simplified
Animatebehavior and its sub-classes. - Improved
Menuclass to support more user customization. - Added
onFocusandonBlurcallback support toTextInputclass.
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
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
optionsarray in config with anitemsarray. Which should be passed instances ofMenu.Item. - Added
Button,Slider, andTogglemenu items.
Additional Changes
- The
Animatebehavior can now automatically overwrite its parentGameObject'srenderableproperty. Simply set the behavior'sconfig.overwriteObjectRenderablevalue totrue. You can runAnimate.resetObjectRenderable()to undo this and restore normal function to the object'srenderableproperty. - Removed requirement for the current
sceneto be passed to behaviors. - Added
positionOnScreenproperty to theGameObjectclass, to quickly get its coordinates on the screen, adjusted for parallax and camera position. - Replaced
RendererdrawFramemethod withdrawFramesmethod. - 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
Menuconstructorconfig.optionsandconfig.callbackproperties with a singleconfig.itemsproperty. To replace the original functionality, you can pass constructedMenu.Buttons to thisitemsarray. EachButtoncan 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
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
Behaviorconstructors to be passed the active scene. They now get the scene from their parentGameObject. - Added
config.overwriteObjectRenderableproperty andresetObjectRenderablemethod toAnimatebehavior. These allow the management of aGameObject'srenderableproperty by itsAnimatebehavior. - Added a
testsdirectory and awebworkerstest to demonstrate the new Web Worker support. - Updated documentation to reflect these changes.
Migration
- Remove the
sceneargument from allBehaviorinstances and classes. Example:- From:
new Behavior(scene, gameObject, true) - To:
new Behavior(gameObject, true)
- From:
Full Changelog: v1.0.28...v1.0.29
Version 1.0.28
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
This version adds gamepad support to the InputManager, as well as restructures many of its methods to improve input listening.
Core Changes
- Added an
examplesdirectory containing example projects that display mouse, keyboard, and gamepad inputs. - Renamed
GameObject__onTickmethods toonTick. - Several
InputManagerchanges/improvements:- Added
GamepadInterfaceclass for simple gamepad input interaction. - Added
types,rawGamepads, andgamepadsproperties toInputManager. - Added mouse scroll wheel event detection and handling.
- Added gamepad event detection and handling.
- Replaced
addOnClickandremoveOnClickmethods withwatchObjectClickandunwatchObjectClick. - Added type requirement to
addEventListenerandremoveEventListener, meaning the provided listener methods will only fire on a specific event.
- Added
Additional Changes
- Added
isPlainObjectmethod todataUtils.- Utilized
isPlainObjectmethod to further validate configuration data passed to various constructors.
- Utilized
- Added
asPixelMeshtoBoxclass that will create the renderable of aBoxwithout creating an actualGameObjectin the scene. - Several bugfixes, most notably:
- Revamped
PixelMeshandLayerframe generation to properly ignore value-invisiblePixels 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."
- Revamped
- Updated documentation to reflect these changes.
- Removed
Pixelinstancewidthandheightproperties. SincePixels are always 1x1. - Added post-construction
originmodification toPixels andPixelMeshs throughorigingetter/setter. - Added
pixelsproperty toPixelMesh. - Added
setColor,setFontWeight,setBackgroundColor,setSolid, andfromStringmethods toPixelMeshclass. - Removed
filterThismethod fromGameObjectclass. - Replaced
InputManager__clickListenersarray with__gameObjectClicks. - Added window blur handling to
InputManager.
Migration
- Replace all
GameObject(and classes that extend them)__onTickmethods withonTick. Functionality remains the same. InputManager:- Use
watchObjectClickandunwatchObjectClickinstead ofaddOnClickandremoveOnClickmethods. Instead of passing aGameObjectas the first parameter, pass theGameObjectinstance'sidproperty. - In ALL
addEventListenerandremoveEventListenercalls: 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.
- Use
- Replace all
Pixel.widthandPixel.heightcalls with1. - Remove all uses of
GameObject.filterThis()method.
Full Changelog: v1.0.26...v1.0.27
Version 1.0.26
Core Changes
- Added
layerargument toGameObjectconstructor. Increasing the efficiency of adding object instances to aLayer. - Made
LayerManagera property ofSceneinstead ofRenderer. - Reverted a change and made the
Rendererinstance a property of theRuntimeinstance again.
Additional Changes
- Replaced
runtimeproperty onCoreinstances with a getter. - Removed
runtimeproperty fromInputManagerandLayerinstances. - Removed
sceneproperty fromLayerinstances. - Updated documentation to reflect these changes.
- Removed unnecessary code from
Cameraclass and decoupled it from theGameObjectclass.
Migration
- Replace all references to
InputManager.runtimewithInputManager.scene.runtime. - Replace all references to
Layer.runtimewithLayer.layerManager.scene.runtime. - Replace all references to
Renderer.layerManagerwithScene.layerManager.
Full Changelog: v1.0.25...v1.0.26
Version 1.0.25
Core Changes
- Added
Layerinstancevisibleattribute getter and setter.GameObjects in an invisible layer will be invisible by proxy. - Added
visibleLayersattribute toLayerManagerclass. This will return an array of theLayers associated with thisLayerManagerwhosevisibleattribute istrue.
Migration
Drop-in-place update. No breaking changes to previous version.
Full Changelog: v1.0.24...v1.0.25