0.5.0 - Touch, audio streaming & native system APIs
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
Touchmodule- front touchscreen support
- rear touchpad support
Touch.read()andTouch.peek()- convenient
Touch.front()andTouch.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
Systemmodule with application and device information- complete
param.sfomanifest 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
- complete
-
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
- new preferred
-
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.