npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pebble-virtual-screen

v1.0.4

Published

A virtual screen implementation for the Pebble smartwatch.

Readme

pebble-virtual-screen

A virtual screen implementation for the Pebble smartwatch.

Use this library to test the layout for large screens (e.g. Pebble Time 2) on smaller screens (e.g. Pebble Time).

There are several modes available:

VIRTUAL_SCREEN_MODE_DIRECT The large screen is centered on the position the watch has when the app starts. You can scroll the screen around by moving the watch.

VIRTUAL_SCREEN_MODE_AUTO The large screen is autmatically moved to the next corner every second. Use this for testing in the emulator.

VIRTUAL_SCREEN_MODE_{CENTERED,TOP_LEFT,TOP_RIGHT,BOTTOM_LEFT,BOTTOM_RIGHT} The large screen remains in a fixed position.

To use a virtual screen you just have to use the Layer returned by virtual_screen_init instead of the root layer you normally use. If you use graphics_capture_frame_buffer to modify the framebuffer you also have to manually apply the offset returned by virtual_screen_get_offset.

You can use the VIRTUAL_SCREEN define to determine whether or not the virtual screen is used. The define is set if pebble-virtual-screen.h is included.

This is how VIRTUAL_SCREEN_MODE_AUTO looks in CloudPebble: BCD minimalist

Usage example:

#include <pebble-virtual-screen/pebble-virtual-screen.h>

static void my_window_load(Window *window) {
  Layer* root_layer = window_get_root_layer(window);
  GRect root_layer_bounds = layer_get_bounds(root_layer);

#ifdef VIRTUAL_SCREEN
  Layer* real_root = root_layer;
  root_layer = virtual_screen_init(root_layer_bounds, VIRTUAL_SCREEN_SIZE_EMERY, VIRTUAL_SCREEN_MODE_AUTO);
  root_layer_bounds = layer_get_bounds(root_layer);
#endif // VIRTUAL_SCREEN

  background_layer = layer_create(root_layer_bounds);
  layer_set_update_proc(background_layer, background_layer_draw);
  layer_add_child(root_layer, background_layer);
  
  time_layer = layer_create(GRectZero);
  layer_set_update_proc(time_layer, time_layer_draw);
  layer_add_child(root_layer, time_layer);

  date_layer = layer_create(GRectZero);
  layer_set_update_proc(date_layer, date_layer_draw);
  layer_add_child(root_layer, date_layer);

#ifdef VIRTUAL_SCREEN
  layer_add_child(real_root, root_layer);
#endif // VIRTUAL_SCREEN
}