Code Monkey home page Code Monkey logo

spritemonster.js's Introduction

SmokeMonster.js

What is SmokeMonster?
	SmokeMonster is John Locke, or is he?
	But seriously, SmokeMonster.js is a small graphics library based on DOM

Why SmokeMonster?
	Well, there had to be some kind of nemesis on the island, right?
	But seriously, we here at Freeze Development have been making video games
	for over two centuries and with our...
	But seriously seriously we are working on ElysionWeb, a HTML5 game framwork
	using Canvas, WebGL and SVG/VML with Raphael as its rendering backends.
	So want if you want to use the DOM to put together some small simple game
	you are doomed if you wanted to use ElysionWeb here. Well, "doomed" is such
 	a strong word here. ;)

    This is what SmokeMonster was made for:
      It's a tiny web graphics library based on Document Object Model (DOM).

    You can make quick and simple Javascript games based on DOM.
    But you should definitely give ElysionWeb a try once it's finished.



How is SmokeMonster?
	Oh, you wanna see how it's done? Here ya go:
		You don't need to initialize anything, just begin creating your
		objects.


    var mySprite = new SmokeMonster.Sprite();
    mySprite.loadFromFile("freckles.png");
    mySprite.position.make(50, 50);
    mySprite.draw();

    This will draw a sprite called mySprite at x: 50 and y: 50. You can
	manipulate additional attributes, like rotation, scaling, opacity, etc.
	Take a look at this:

	mySprite.alpha = 128;
	mySprite.angle = 22.5;
	mySprite.scale.x = 2.5;

	Now our sprite is being drawn with at half opacity, rotated 22.5 degrees
	and its witdth scale at factor 2.5.


	var myContainer = new SmokeMonster.Container(200, 200);
	myContainer.position.make(60, 60);
	myContainer.backgroundColor.make(255, 255, 0);
	myContainer.borderRadius.make(15, 15);
	myContainer.draw();

	A container can be actually be everything you want it to be, for example
	a rect, a rounded rect (which it is in this example), or just an object
	for grouping child objects.
    The constructor takes width and height parameter, after that the position
	will be set to Left: 60 | Top: 60, with a yellow background color and
	a barder radius of 15 pixels.
	The draw() method needs to be called on every object to be displayed
	on the page.


	Grouping objects:
    The first parameter of an object can also take the parent object, in which
	case the new object will be the child object of the specified object.
	The child object position is then relative, the parent object's position
	is still absolute.
	If you want to get the absolute position of an object, use the
	the method getAbsolutePosition() which will return the position
	as elVector.

	mySprite = new elSprite(myContainer);
    mySprite.position.make(40, 40);

	mySprite will now be drawn at Left: 100 | Top: 100. By default and if
	not specified any different the child object's attributes will be the
	same as the parent's. Except for unique attributes.



So, that were the basics, if you want to know more take a look at the
examples and read the documentation.


This whole SmokeMonster thing was made in just a few days. It hasn't been
a constant development though, just a few hours every now and then.

There won't probably be much new features after this initial relase, as
we will concentrate our efforts on ElysionWeb. There may be a bug fix release
if users find some nasty bugs.


License:
Copyright (C) 2011 by Johannes Stein, Freeze Development (http://www.freeze-dev.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

spritemonster.js's People

Contributors

frostney avatar

Watchers

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