Giter Site home page Giter Site logo

samme / phaser-plugin-game-gui Goto Github PK

View Code? Open in Web Editor NEW
36.0 4.0 3.0 1.39 MB

Inspect and manipulate some common game settings. Phaser 2/CE

Home Page: https://samme.github.io/phaser-plugin-game-gui/

JavaScript 99.75% CoffeeScript 0.21% HTML 0.04%
phaser dat-gui

phaser-plugin-game-gui's Introduction

Screenshot

Demo

Quick access to some common game settings and commands:

  • Pause and frame-stepping
  • Restart current state
  • Camera flash, shake, position, and lerp
  • Input (keyboard, mouse, touch) toggles
  • Scale mode, start/stop fullscreen
  • Sound mute and volume
  • Slow motion

Install

If not using bower or npm, include dat.gui and index.js before your game scripts.

Use

// In init() or create():
// (If you've resized `world` or `camera`, add the plugin **after** those changes.)
game.plugins.add(Phaser.Plugin.GameGui);

You can also pass options and access the GUI itself:

var gameGuiPlugin = game.plugins.add(Phaser.Plugin.GameGui, {
  // Default options:
  autoPlace: true,
  width: 245,
});

gameGuiPlugin.gui.width = 400;
gameGuiPlugin.gui.closed = true;
gameGuiPlugin.gui.destroy();

Thanks

Demo sound effects by Eric Matyas www.soundimage.org

phaser-plugin-game-gui's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

phaser-plugin-game-gui's Issues

phaser is undefined

@samme if i use these lines taken from your other debug lib(SpriteGUI):

  Phaser = Phaser || (typeof window !== "undefined" && window !== null ? window.Phaser : void 0) || (typeof require === "function" ? require("phaser") : void 0);
  dat = dat || (typeof window !== "undefined" && window !== null ? window.dat : void 0) || (typeof require === "function" ? require("./dat.gui") : void 0);

it will work but otherwise just leaving it with this:

dat = this.dat, Phaser = this.Phaser; will result in Phaser is undefined

this.phaser is undefined in the first place

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.