Commit 2a3dd0f2 authored by Cody Ede (cme527)'s avatar Cody Ede (cme527)
Browse files

testBrowserSize

parent f7cc5f27
......@@ -6,7 +6,6 @@ var BG_COLOR_HOVER = 0xd6d6d6;
function FastTapMenuItem(name, iconPath, width, height) {
PIXI.Container.call(this);
this.name = name;
this.w = width;
this.h = height;
......@@ -45,8 +44,8 @@ FastTapMenuItem.prototype.updateLayout = function() {
this.label.position.y = Math.floor(this.h - (this.h / 5));
this.icon.anchor.x = 0.5;
this.icon.anchor.y = 0.5;
this.icon.width = this.w / 2;
this.icon.height = this.w / 2; // wont work with non-square icons
this.icon.width = this.w / 4;
this.icon.height = this.w / 4; // wont work with non-square icons
this.icon.position.x = this.w / 2;
this.icon.position.y = this.h / 2;
......@@ -59,4 +58,4 @@ FastTapMenuItem.prototype.updateLayout = function() {
this.bg.drawRect(0,0,this.w,this.h);
};
module.exports = FastTapMenuItem;
\ No newline at end of file
module.exports = FastTapMenuItem;
var kd = require('keydrown');
function KeyboardManager() {
this._keydown = false;
this._aKeydown = false;
this._stateChangeHandlers = [];
}
var keyBindArray = [['a','b'],['c','d']];
KeyboardManager.prototype.tick = function() {
kd.tick();
if (kd.A.isDown() && this._keydown == false) {
this._keydown = true;
if (kd.A.isDown() && this._aKeydown == false) {
this._aKeydown = true;
this.notifyObservers();
} else if (!kd.A.isDown() && this._keydown == true) {
this._keydown = false;
} else if (!kd.A.isDown() && this._aKeydown == true) {
this._aKeydown = false;
this.notifyObservers();
}
};
KeyboardManager.prototype.notifyObservers = function() {
for (var i = 0; i < this._stateChangeHandlers.length; i++) {
this._stateChangeHandlers[i](this._keydown);
this._stateChangeHandlers[i](this._aKeydown);
}
};
......
......@@ -19,4 +19,4 @@ Stimulus.prototype.update = function(delta) {
Stimulus.prototype.render = function() {
};
module.exports = Stimulus;
\ No newline at end of file
module.exports = Stimulus;
......@@ -8,10 +8,10 @@ var PIXI = require('pixi.js'),
Experiment = require('./LearningExperiment.js');
var STAGE_BG = 0xffffff;
var WIDTH = 1260;
var WIDTH = 2060;
var HEIGHT = 810;
var renderer = new PIXI.autoDetectRenderer(WIDTH, HEIGHT,{backgroundColor: 0xFFFFFF});
var renderer = new PIXI.autoDetectRenderer(WIDTH, HEIGHT,{backgroundColor: STAGE_BG});
document.body.appendChild(renderer.view);
var interactive = true;
var container = new PIXI.Container();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment