0.0.4 • Published 9 years ago

pex-screensize v0.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

pex-screensize

pex-screensize is depracated

plask.Window has now screensInfo() deanm/plask@d727b5c, and pex-sys/Window now implements fullscreen on desktop.

Screen size module for pex library. Works in browser and with Plask on OSX, in OSX returns dimmensions of all attached displays, in browser returns current window width and height.

Example

Works both in browser and in Plask on OSX.

var Window = require("pex-sys").Window;

var ScreenSize = require("pex-screensize");
var screenSize = new ScreenSize();
var screenNumber = 1; // optional settings for multiple monitors on OSX/Plask

screenSize.fullscreenSettings(function(error, settings) {
  if (error) { console.error(error); }

  Window.create({
    settings: settings,

    init: function() {
      console.log("init with size", this.width, this.height);
    },

    draw: function() {
    }
  });
}, screenNumber);

Methods

screens(callback)

Callbacks with array of detected screens, arguments:

  • callback(error, screens) - screens is array of available screens filled with object containing width and height fields

fullscreenSettings(callback, screenNumber )

Callbacks with settings required to run application in fullscreen, arguments:

  • callback(error, settings) - settings is object containing all needed settings to run Pex application in fullscreen
  • screenNumber - optional integer for OSX to select different display, automatically defaults to 0
0.0.4

9 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago