Skip to content

0.5.0 - Touch, audio streaming & native system APIs

Choose a tag to compare

@AlphaSystemsPL AlphaSystemsPL released this 17 Aug 08:44
· 1 commit to master since this release

VitaJS v0.5.0 significantly expands the native PS Vita APIs available from JavaScript, with new touch input, streamed audio.

What's new

  • Added the new Touch module

    • front touchscreen support
    • rear touchpad support
    • Touch.read() and Touch.peek()
    • convenient Touch.front() and Touch.back() helpers
    • touch coordinates, force and touch IDs
    • panel information
    • sampling and force-mode controls
  • Added streamed audio playback

    • WAV and OGG/Vorbis streams
    • playback without loading the complete audio file into memory
    • play, pause, resume and stop controls
    • looping
    • per-stream volume
    • seeking
    • playback position and duration queries
  • Expanded the System module with application and device information

    • complete param.sfo manifest access
    • title ID
    • application title and short title
    • application version
    • category and content ID
    • system language and language ID
    • PS Vita / PS Vita TV model detection
    • isPSTV
  • Improved controller support through Pads

    • new preferred Pads.read() API
    • one controller poll returns buttons and both analog sticks
    • controller port support
    • rumble support
    • controller battery information
    • sampling mode controls
    • additional controller and button constants
  • Updated VitaJS JavaScript/TypeScript declarations for the expanded runtime API

  • Expanded documentation and examples for the new native modules

Example

const music = Audio.open_stream("app0:/assets/music.ogg");

Audio.play_stream(music, 0.5, true);

const touch = Touch.front();

if (touch.count > 0) {
    console.log(
        touch.touches[0].x,
        touch.touches[0].y
    );
}

console.log(System.title);
console.log(System.language);
console.log(System.model);

Installation

Download vitajs-v0.5.0.vpk below and install it on your PS Vita.

VitaJS is still experimental. APIs may change between releases and testing on real PS Vita hardware is recommended.