sbiermanlytle / iioEngine

iio Engine: A JavaScript game engine for HTML5 Canvas
http://iioengine.com
455 stars 81 forks source link

Pause / getGroup / alpha / floating text functionality #3

Closed Bahlor closed 11 years ago

Bahlor commented 11 years ago

simple set the rendering loop on hold.

io.pauseFramerate(bool); // true to stop, false to go on

Functionality to get objects from group.

io.getGroup('TAG','CANVAS',from,to);

Only tag is necessary. Tag and canvas should be familiar from addToGroup etc. "from" / "to" allows to reduce the returned object as needed. If "from" is given and no "to", it will automatically fetch the first value beggining at "from"

Possibility to use ioObject.styles.alpha = 0.25; to make object transparent.

Text can now float, just use .setWrap() and .setLineHeight(). Example:

Helloiio = function(io){
        var text = new iio.ioText('Hello iio!!', io.canvas.center)
              .setFont('30px Consolas')
              .setTextAlign('center')
              .setFillStyle('black')
              .setWrap(100)
              .setLineHeight(34);

          io.addObj(text);
        }; iio.start(Helloiio);

iio.start(Helloiio);