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