Skip to content

Version 1.0.27

Compare
Choose a tag to compare
@NotTimTam NotTimTam released this 30 Sep 23:17

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