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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@smallstoneapps/scroll-text-layer

v1.3.0

Published

Pebble library for easily adding a scrollable text layer to your app.

Downloads

7

Readme

Scroll Text Layer npm (scoped) MIT License

Pebble library for easily adding a scrollable text layer to your app.

Screenshot of library in action

Installation

You must be using Pebble SDK 3.12 or newer to use this library.

To install the package to your app, use the pebble tool:

pebble package install @smallstoneapps/bitmap-loader

Usage

// This is not a complete example, but should demonstrate the basic usage of a ScrollTextLayer.

static ScrollTextLayer* scroll_text;
static char* long_text = "Bacon ipsum dolor sit amet ribeye brisket leberkas, frankfurter pork loin salami biltong. \nPig spare ribs drumstick filet mignon tongue, rump pork belly andouille ball tip shoulder chuck sausage. Beef rump pig hamburger ham hock. Hamburger landjaeger cow, frankfurter drumstick ball tip pork swine tongue shoulder prosciutto t-bone flank chicken. \nTri-tip shoulder tongue pork belly, beef ribs pancetta flank tenderloin. Capicola hamburger t-bone ground round spare ribs rump, brisket tongue flank ball tip short ribs. Beef pork chop flank pork belly pig chuck.";

static void window_load(Window* window) {
  scroll_text = scroll_text_layer_create_fullscreen(window);
  scroll_text_layer_set_system_font(scroll_text, FONT_KEY_GOTHIC_18);
  scroll_text_layer_set_text(scroll_text, long_text);
  scroll_text_layer_add_to_window(scroll_text, window);
}

Function Documentation

Basic Functions

Create a new ScrollTextLayer.

ScrollTextLayer* scroll_text_layer_create(GRect rect);

Destroy a ScrollTextLayer.

void scroll_text_layer_destroy(ScrollTextLayer* layer);

Get the pointer to the internal TextLayer for a ScrollTextLayer.

TextLayer* scroll_text_layer_get_text_layer(ScrollTextLayer* layer);

Get the pointer to the internal ScrollLayer for a ScrollTextLayer.

ScrollLayer* scroll_text_layer_get_scroll_layer(ScrollTextLayer* layer);

Add the ScrollTextLayer to the window.

void scroll_text_layer_add_to_window(ScrollTextLayer* layer, Window* window);

Set the text for the ScrollTextLayer. Note: This behaves in the same was as a normal TextLayer, so you must responsible for keeping the text in memory (e.g. making it a static variable)

void scroll_text_layer_set_text(ScrollTextLayer* layer, char* text);

Utility Functions

Create a new ScrollTextLayer that is the size of a window.

ScrollTextLayer* scroll_text_layer_create_fullscreen(window) scroll_text_layer_create(layer_get_bounds(window_get_root_layer(window)));

Set the text colour of the ScrollTextLayer.

void scroll_text_layer_set_text_color(layer, color) text_layer_set_text_color(scroll_text_layer_get_text_layer(layer), color)

Set the background colour of the ScrollTextLayer.

void scroll_text_layer_set_background_color(layer, color) text_layer_set_background_color(scroll_text_layer_get_text_layer(layer), color)

Set the font of the ScrollTextLayer.

void scroll_text_layer_set_font(layer, font) text_layer_set_font(scroll_text_layer_get_text_layer(layer), font)

Set the text alignment of a ScrollTextLayer.

void scroll_text_layer_set_text_alignment(layer, alignment) text_layer_set_text_alignment(scroll_text_layer_get_text_layer(layer), alignment)

Set the font of the ScrollTextLayer to a system font.

void scroll_text_layer_set_system_font(layer, font) scroll_text_layer_get_text_layer(layer, fonts_get_system_font(font))