Loader.addToManifest(Loader.manifestPreload,{ splash_peep: "assets/splash/splash_peep.json", connection: "assets/splash/connection.json", cssAsset13: "assets/ui/sound.png" }); function Splash(config){ var self = this; self.id = config.id; // Dimensions, yo var width = $("#main").clientWidth; var height = $("#main").clientHeight; var x = -(width-960)/2; var y = -(height-540)/2; // DOM self.dom = document.createElement("div"); self.dom.className = "object"; self.dom.style.left = x+"px"; self.dom.style.top = y+"px"; // APP var app = new PIXI.Application(width, height, {transparent:true, resolution:2}); app.view.style.width = width; app.view.style.height = height; self.dom.appendChild(app.view); // CONTAINERS var edgesContainer = new PIXI.Container(); var peepsContainer = new PIXI.Container(); app.stage.addChild(edgesContainer); app.stage.addChild(peepsContainer); // PEEPS var peeps = []; self.addPeep = function(x, y){ var peep = new SplashPeep({ x:x, y:y, app:app, blush:config.blush }); peeps.push(peep); peepsContainer.addChild(peep.graphics); }; // EDGES var edges = []; self.addEdge = function(from, to){ var edge = new SplashEdge({ from:from, to:to }); edges.push(edge); edgesContainer.addChild(edge.graphics); }; // Create RINGS var _createRing = function(xRadius, count){ yRadius = xRadius*(350/400); var increment = (Math.TAU/count)+0.0001; for(var angle=0; angle