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

gdrweb

v0.2.0

Published

Geometry Dash Level Rendering Engine for the browser

Downloads

30

Readme

GDRWeb

A Geometry Dash Level Rendering Engine for the web.

What is GDRWeb?

It is a work-in-progress rendering engine for rendering Geometry Dash levels on web-based applications. The engine is written in Typescript and currently only supports WebGL 2.0. However, rendering contexts are easily expandable. GDRWeb has the following features:

  • Real-Time Object Insertion/Deletion
  • Color Trigger Support
  • Alpha Trigger Support
  • Pulse Trigger Support
  • Move Trigger Support
  • Toggle Trigger Support
  • Stop Trigger Support
  • Object HSV Shifting
  • Copy Colors

The engine is also pretty fast as it uses batch rendering and currently renders everything in one draw call. It is also random access meaning that you can go anywhere in a level and the renderer will automatically recalculate all trigger states for you. Instead of having to play the level from the beginning.

Acu in GDRWeb White Space in GDRWeb

How to use GDRWeb?

GDRWeb is easy to include into your Javascript project. You need to install the GDRWeb NPM package into your project. After that, you can require GDRWeb in a Javascript file and use it like this:

const * as gdr = require('gdrweb');
/*
// If you're using ES modules, the following line should work as well:
import * as gdr from 'gdrweb';
*/

window.onload = () => {
    // Getting the canvas. You can create the canvas in any
    // way you want.
    let canvas = document.getElementById('canvas');

    (async () => {
        // Loading all the texture plists. These can be found
        // in the /Resources folder in the Geometry Dash game
        // directory. Put them in your project folder and
        // and give the path as an argument in this function:
        await gdr.Renderer.initTextureInfo(
            "GJ_GameSheet-hd.plist",
            "GJ_GameSheet02-hd.plist"
        );

        // Creating the renderer using a WebGL context. You also
        // have to specify the path to the game sheets. These
        // can also be found in the /Resources folder
        let renderer = new gdr.Renderer(
            new gdr.WebGLContext(canvas),
            "GJ_GameSheet-hd.png",
            "GJ_GameSheet02-hd.png"
        );

        // Set the camera position
        renderer.camera.x = 0;
        renderer.camera.y = 0;

        // Here, you create the level using the raw
        // level string
        const levelString = "...";
        let level = gdr.Level.parse(levelString);

        // Alternatively, you can load from a level file (.lvl, .gmd)
        level = gdr.Level.loadFromFile("path/to/level.gmd");

        // When the renderer is loaded, render the level
        renderer.on('load', () => {
            renderer.render(level);
        });
    })();
}

This won't work like that on your browser. Rather this has to be bundled using a web bundler. This should work with any web bundler out of the box.

Following web bundlers have been tested: vite, webpack and browserify.

How you run your app depends on your web bundler.

Want to contribute?

Here's how you can run the test application.

First, install all dependencies:

npm install

Then run the developement server:

npm run dev

Then open the localhost link given by the command. You can now add changes to the engine and the page should then automatically refresh.

Credits