luna-retro-emulator
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Luna Retro Emulator

Retro emulator using libretro.

Demo

https://luna.liriliri.io/?path=/story/retro-emulator

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-retro-emulator/luna-retro-emulator.css" />
<script src="//cdn.jsdelivr.net/npm/luna-retro-emulator/luna-retro-emulator.js"></script>

You can also get it on npm.

npm install luna-retro-emulator --save
import 'luna-retro-emulator/luna-retro-emulator.css'
import LunaRetroEmulator from 'luna-retro-emulator'

Usage

const retroEmulator = new RetroEmulator(container, {
  core: 'https://res.liriliri.io/luna/fceumm_libretro.js',
  browserFS: 'https://res.liriliri.io/luna/browserfs.min.js',
})
retroEmulator.load('https://res.liriliri.io/luna/Contra.nes')

Configuration

  • browserFS(string): BrowserFS url.
  • config(string): RetroArch config.
  • controls(boolean): Show controls.
  • core(string): Libretro core url.
  • coreConfig(string): RetroArch core options.

Api

load(url: string): void

Load rom from url.

open(): Promise

Open file and load rom.

pressKey(code: string): void

Press key.

releaseKey(code: string): void

Release key.

reset(): void

Reset game.

toggleFullscreen(): void

Toggle fullscreen.

Readme

Keywords

Package Sidebar

Install

npm i luna-retro-emulator

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

223 kB

Total Files

12

Last publish

Collaborators

  • surunzi