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

react-pico-8

v4.1.0

Published

Run PICO-8 game cartridges in React

Downloads

51

Readme

React PICO-8

img img img img img

Run PICO-8 game cartridges using a cusomtizable React component.

Live Demo

Note: This project is community made and not endorsed by Lexaloffle or the offical PICO-8 Fantasy Console.

img

Installation

Yarn

yarn add react-pico-8

npm

npm install react-pico-8

Usage

import React from 'react'
import Pico8 from 'react-pico-8'
import { Controls,
         Reset,
         Pause,
         Sound,
         Carts,
         Fullscreen } from 'react-pico-8/buttons'
import 'react-pico-8/styles.css'

const App = () => (
  <Pico8 src="index.js"
         autoPlay={true}
         legacyButtons={false}
         hideCursor={false}
         center={true}
         blockKeys={false}
         usePointer={true}
         unpauseOnReset={true}
         placeholder="placeholder.png"
  >
    <Controls/>
    <Reset/>
    <Pause/>
    <Sound/>
    <Carts/>
    <Fullscreen/>
  </Pico8>
)

Simply add the game widget to the React application using JSX.

Be sure to include the .js src of the game cartridge generated from PICO-8's web export.

If no buttons are nested in the component then the default PICO-8 buttons will be used.

Props

Src

Source of the game cartridge. Required

This can be obtained from PICO-8 by loading a game cart, then typing the command export index.html.

PICO-8 produces two files: the cartridge index.js and the player index.html.

Since react-pico-8 already has the game player embeded, only the .js file needs to be provided as the src.

Auto Play

autoPlay indicates if the game canvas should attempt to auto-play on page-load. Default: true

Legacy Buttons

legacyButtons is used to select the type of buttons. Default: false

Hide Cursor

hideCusor indicates if the cursor is hidden over the game canvas when the game is playing. Default: false

Center

center indicates if the game is centred outside of fullscreen mode. Default: true

Block Keys

If blockKeys is set keys which are used to interact with the game are blocked from scrolling when the game is running.

If un-set keys will only be blocked when the canvas is focused. Default: false

Use Pointer

If usePointer is set the pointer hand will be used on buttons.

If un-set a normal cursor will be used on all buttons which do not lead to a new page. Default: true

Unpause On Reset

If unpauseOnReset is set hitting the reset button when paused will instantly reset the game.

If un-set the game will need to be resumed before it resets. Default: true

Placeholder

The image to be used as a placeholder prior to starting the game. If un-set, a black background will be used. Default: ''