Giter Club home page Giter Club logo

magicbox.js's Introduction

MagicBox.js

About

MagicBox is a jQuery-UI plugin that helps you create UI for your web-games.

Note

( The code may be a little bit messy at this moment, but I will do my best to make the code as clean as possible and also re-structure it to follow the jQuery-UI "standard" widget concept )

Known bugs

  • inventory slots are not centered properly once the number of cols or rows exceeds 4.

TODO List:

  • widget.Inventory
    • make panel draggable/droppable
    • make panel not to colide with each other
    • make items draggable/droppable
    • stack items when item.type is equal
    • switch item positions when item.type is not equal
    • show item stats
    • change the way of assigning icons to items (use css)
  • widget.RPG_text
  • widget.RPG_attributer
  • miniTemplate.js
    • load template using Ajax
    • read template and evaluate all variables

Features

Inventory

  • Items
    • All items are draggable/droppable
    • stats are shown, while hovering over item's icon.
    • Items of same type can be stacked, different types will just switch their positon.
  • Panel
    • Panel's colision detection won't let you place panels over each other.
    • it's possible now to move around with entire inventory panel.
  • General
    • Each widget has it's own template to generate the layout.

Example

$('#element').inventory({
	rows: 2,
	cols: 2,
	widgets: {
		panel: {
			template: "./js/templates/inventory_panel.jst"
		},
		slot: {
			template: "./js/templates/inventory_slot.jst"
		},
		item: {
			template: "./js/templates/inventory_item.jst"
		}
	}
});

Requirements

  • jQuery version >= 1.10.x
  • jQuery-UI version >= 1.10.x

magicbox.js's People

Contributors

alexus85 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.