neiltron / lil-gui-imagecontroller

A lil image controller for lil-gui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lil-gui-imagecontroller

An image module for lil-gui. Inspired by dat.gui.image by @jeremboo.

Installation

npm install lil-gui-imagecontroller

Usage

import { GUI } from 'lil-gui';
import { ImageController } from 'lil-gui-imagecontroller';

const gui = new GUI();
const image = new Image();
image.src = 'cool.gif';

const imageController = new ImageController(gui, image, 'src')
    .name(propName)
    .onChange((image, firstTime) => {
        /*
            do something nice with your lil image. maybe update
            the DOM or swap out a threejs texture.
        */
    });

This creates a new lil-gui instance and an ImageController instance attached to the image's src value.

About

A lil image controller for lil-gui


Languages

Language:JavaScript 100.0%