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
examples
directory containing example projects that display mouse, keyboard, and gamepad inputs. - Renamed
GameObject
__onTick
methods toonTick
. - Several
InputManager
changes/improvements:- Added
GamepadInterface
class for simple gamepad input interaction. - Added
types
,rawGamepads
, andgamepads
properties toInputManager
. - Added mouse scroll wheel event detection and handling.
- Added gamepad event detection and handling.
- Replaced
addOnClick
andremoveOnClick
methods withwatchObjectClick
andunwatchObjectClick
. - Added type requirement to
addEventListener
andremoveEventListener
, meaning the provided listener methods will only fire on a specific event.
- Added
Additional Changes
- Added
isPlainObject
method todataUtils
.- Utilized
isPlainObject
method to further validate configuration data passed to various constructors.
- Utilized
- Added
asPixelMesh
toBox
class that will create the renderable of aBox
without creating an actualGameObject
in the scene. - Several bugfixes, most notably:
- Revamped
PixelMesh
andLayer
frame generation to properly ignore value-invisiblePixel
s 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
Pixel
instancewidth
andheight
properties. SincePixel
s are always 1x1. - Added post-construction
origin
modification toPixel
s andPixelMesh
s throughorigin
getter/setter. - Added
pixels
property toPixelMesh
. - Added
setColor
,setFontWeight
,setBackgroundColor
,setSolid
, andfromString
methods toPixelMesh
class. - Removed
filterThis
method fromGameObject
class. - Replaced
InputManager
__clickListeners
array with__gameObjectClicks
. - Added window blur handling to
InputManager
.
Migration
- Replace all
GameObject
(and classes that extend them)__onTick
methods withonTick
. Functionality remains the same. InputManager
:- Use
watchObjectClick
andunwatchObjectClick
instead ofaddOnClick
andremoveOnClick
methods. Instead of passing aGameObject
as the first parameter, pass theGameObject
instance'sid
property. - In ALL
addEventListener
andremoveEventListener
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.
- Use
- Replace all
Pixel.width
andPixel.height
calls with1
. - Remove all uses of
GameObject.filterThis()
method.
Full Changelog: v1.0.26...v1.0.27