GithubHelp home page GithubHelp logo

maitredede / castorgui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from egire/castorgui

0.0 2.0 0.0 3.9 MB

Library to display a game GUI as a layer on top of the canvas html5.

License: Apache License 2.0

HTML 1.75% CSS 0.26% JavaScript 97.54% Batchfile 0.46%

castorgui's Introduction

CastorGUI V1.3

Library to display a GUI game as a layer on top of the canvas HTML/CSS. This library has been created for CastorEngine, the editor of game and as extention for BabylonJS, the game engine 3d.

Features:

  • Create texture
  • Create text
  • Create window draggable (with title & button close)
  • Create dialog (with button close)
  • Create panel (simple dialog without button close)
  • Create button
  • Create slider
  • Create progress
  • Create spinner
  • Create meter
  • Create radio button
  • Create checkbox
  • Create textfield
  • Create textarea
  • Create label
  • Create fieldset
  • Create select with options

Quick overview of use

We must create a GUIManager that allows to recover the origin of the canvas and provides other basic thing. A GUIManager can have a CSS that Formatted anything you want to customize your GUI.

var canvas = document.getElementById("game");
var css = "button {cursor:pointer;}";
var guisystem = new CASTORGUI.GUIManager(canvas, css);

Then we create interfaces items. eg textures and dialog with text:

var myFunction = function() { alert("Yes, this work!"); };
var guiTexture = new CASTORGUI.GUITexture("life", "data/image.png", {w:50,h:50,x:10,y:0}, guisystem, myFunction);

var optionsDialog = {w: (guisystem.getCanvasWidth().width - 20), h: 100, x: 8, y: (guisystem.getCanvasWidth().height - 110)};
var dialog = new CASTORGUI.GUIDialog("dialog", optionsDialog, guisystem);
dialog.setVisible(true);

var text = new CASTORGUI.GUIText("textDialog", {size:15, text:"Display text here"}, guisystem, false);
dialog.add(text);

That's it. Everything works the same way with the same simplicity.

castorgui's People

Watchers

 avatar  avatar

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.