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

Fixed Canvas Bug

parent 742c44f8
......@@ -17,7 +17,7 @@ BlindTrial.prototype = Object.create(Trial.prototype);
BlindTrial.prototype.start = function() {
this.experiment.fastTapMenu.openable = false;
this.experiment.stimulus.setByItem(items.getItemByName(this.stimulus));
this.experiment.instructions.setText(Strings['side-instructions-blind']);
this.experiment.instructions.Text = (Strings['side-instructions-blind']);
this.startTimestamp = +moment();
......@@ -51,4 +51,4 @@ BlindTrial.prototype.update = function(delta) {
};
module.exports = BlindTrial;
\ No newline at end of file
module.exports = BlindTrial;
......@@ -64,7 +64,7 @@ ConfidenceRating.prototype.close = function() {
};
ConfidenceRating.prototype.setMessage = function(s) {
this.message.setText(s);
this.message.text = s;
this.updateLayout();
};
......@@ -128,7 +128,7 @@ function Button(labelText, id) {
Button.prototype.setLabel = function(labelText) {
this.text = labelText;
this.label.setText(this.text);
this.label.Text = this.text;
this.updateLayout();
};
......@@ -149,4 +149,4 @@ Button.prototype.updateLayout = function() {
this.bg.drawRect(0,0,this.width,this.height);
};
module.exports = ConfidenceRating;
\ No newline at end of file
module.exports = ConfidenceRating;
......@@ -9,10 +9,10 @@ function Instructions() {
this.updateLayout();
}
Instructions.prototype.setText = function(text) {
Instructions.prototype.Text = function(text) {
if (text !== this.text) {
this.text = text;
this.textSprite.setText(this.text);
this.textSprite.Text = text;
this.updateLayout();
}
};
......@@ -22,4 +22,4 @@ Instructions.prototype.updateLayout = function() {
this.textSprite.position.x = Math.floor(this.width / 2 - this.textSprite.width / 2);
};
module.exports = Instructions;
\ No newline at end of file
module.exports = Instructions;
......@@ -5,6 +5,8 @@ function KeyboardManager() {
this._stateChangeHandlers = [];
}
var keyBindArray = [['a','b'],['c','d']];
KeyboardManager.prototype.tick = function() {
kd.tick();
if (kd.A.isDown() && this._keydown == false) {
......
......@@ -16,7 +16,7 @@ TrainTrial.prototype = Object.create(Trial.prototype);
TrainTrial.prototype.start = function() {
this.experiment.fastTapMenu.openable = true;
this.experiment.stimulus.setByItem(items.getItemByName(this.stimulus));
this.experiment.instructions.setText(Strings["side-instructions-train"]);
this.experiment.instructions.Text = (Strings["side-instructions-train"]);
this.startTimestamp = +moment();
this.handleItemClick = function(data) {
......
......@@ -11,10 +11,10 @@ var STAGE_BG = 0xffffff;
var WIDTH = 1260;
var HEIGHT = 810;
var renderer = new PIXI.CanvasRenderer(WIDTH, HEIGHT);
var renderer = new PIXI.CanvasRenderer(WIDTH, HEIGHT,{backgroundColor 0xFFFFFF});
document.body.appendChild(renderer.view);
var interactive = true;
var stage = new PIXI.Stage(STAGE_BG, interactive);
var container = new PIXI.Container();
var qs = url.parse(window.location.href, true).query;
......@@ -42,7 +42,7 @@ var experiment = new Experiment({
});
container.addChild( experiment.view );
stage.addChild(container);
function _rescale() {
var ratio = Math.min(($(window).width()-20) / WIDTH, ($(window).height()-20) / HEIGHT);
......@@ -69,6 +69,6 @@ MainLoop.run({
},
render: function() {
experiment.render();
renderer.render(stage);
renderer.render(container);
}
});
......@@ -11,10 +11,9 @@ var STAGE_BG = 0xffffff;
var WIDTH = 1260;
var HEIGHT = 810;
var renderer = new PIXI.CanvasRenderer(WIDTH, HEIGHT);
var renderer = new PIXI.autoDetectRenderer(WIDTH, HEIGHT,{backgroundColor: 0xFFFFFF});
document.body.appendChild(renderer.view);
var interactive = true;
var stage = new PIXI.Stage(STAGE_BG);
var container = new PIXI.Container();
var qs = url.parse(window.location.href, true).query;
......@@ -41,8 +40,8 @@ var experiment = new Experiment({
reset: reset
});
container.addChild( experiment.view );
stage.addChild(container);
function _rescale() {
var ratio = Math.min(($(window).width()-20) / WIDTH, ($(window).height()-20) / HEIGHT);
......@@ -69,6 +68,6 @@ MainLoop.run({
},
render: function() {
experiment.render();
renderer.render(stage);
renderer.render(container);
}
});
......@@ -16,6 +16,7 @@
"dependencies": {
"async": "^0.9.0",
"browserify": "^8.1.1",
"canvas": "^1.2.2",
"ejs": "^2.2.4",
"express": "^4.11.1",
"jquery": "^2.1.3",
......
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