This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Test for correctly dispatching mouseover/mouseout for LimeJS objects | |
Usage: scene.listenOverOut(shape,function(e){ console.log('over'); }, function(e){ console.log('out'); }); | |
Advice welcome about how to have the same result with more LimeJS/Closure style API. | |
*/ | |
lime.Scene.prototype.listenOverOut = (function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goog.provide('test.box2d'); | |
goog.require('box2d.BodyDef'); | |
goog.require('box2d.BoxDef'); | |
goog.require('box2d.CircleDef'); | |
goog.require('box2d.CircleShape'); | |
goog.require('box2d.PolyDef'); | |
goog.require('box2d.Vec2'); | |
goog.require('box2d.JointDef'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goog.provide('test.box2d_3'); | |
goog.require('box2d.BodyDef'); | |
goog.require('box2d.BoxDef'); | |
goog.require('box2d.CircleDef'); | |
goog.require('box2d.CircleShape'); | |
goog.require('box2d.PolyDef'); | |
goog.require('box2d.Vec2'); | |
goog.require('box2d.JointDef'); | |
goog.require('box2d.MouseJointDef'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set main namespace | |
goog.provide('Controller'); | |
//get requirements | |
goog.require('lime.Director'); | |
goog.require('lime.Scene'); | |
goog.require('lime.Layer'); | |
goog.require('lime.Circle'); | |
goog.require('lime.Label'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goog.provide('remote.Joystick'); | |
goog.require('lime.Sprite'); | |
goog.require('lime.animation.FadeTo'); | |
goog.require('lime.Circle'); | |
goog.require('goog.events.Event'); | |
/** | |
Usage: | |
var joystick = new remote.Joystick().setSize(200, 200).setFill('#c00').setPosition(100, 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Still support old way: | |
var tromboon = new lime.audio.Audio('assets/tromboon_sample.mp3'); | |
tromboon.play(); | |
tromboon.stop(); | |
// Support for audio sprites: | |
// Actual Zynga Player is created on first touch of the director. | |
var audio = new lime.audio.AudioMap({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lime.Node.prototype.clone = function() { | |
var copy = new this.constructor() | |
.setScale(this.getScale()) | |
.setPosition(this.getPosition()) | |
.setSize(this.getSize()) | |
.setAnchorPoint(this.getAnchorPoint()) | |
.setRotation(this.getRotation()) | |
.setAutoResize(this.getAutoResize()) | |
.setOpacity(this.getOpacity()); | |
for (var i = 0; i < this.children_.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Color comparison for LimeJS shapes | |
* Usage: | |
* if (sprite.getFill().equals('#c00')) {} | |
* if (sprite.getFill().equals('rgb(100, 0, 0)')) {} | |
* if (sprite.getFill().equals(othersprite.getFill())) {} | |
*/ | |
lime.fill.Color.prototype.equals = function (other) { | |
other = lime.fill.parse(other); | |
return this.r == other.r && this.g == other.g && this.b == other.b && this.a == other.a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set main namespace | |
goog.provide('keycontrol'); | |
/** | |
* Sample for using keyboard to naturally move around lime objects. | |
*/ | |
//get requirements | |
goog.require('lime.Director'); | |
goog.require('lime.Scene'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var EventEmitter = require('events').EventEmitter; | |
/** | |
* Only works with https://github.com/tonistiigi/stylus/tree/sourcemaps | |
* Usage: | |
* var StylusInfo = require('./stylusinfo').StylusInfo; | |
* var logger = new StylusInfo(); | |
* var options = ... | |
* options._info = logger; | |
* stylus(str, options).render(function(err, css) { |
OlderNewer