mirror of
https://github.com/boxgaming/qbjs.git
synced 2024-09-20 04:24:45 +00:00
Framed accommodations for Screen 1.
This commit is contained in:
parent
62153b8001
commit
a7a0fbedbb
1 changed files with 35 additions and 6 deletions
41
qb.js
41
qb.js
|
@ -34,6 +34,7 @@ var QB = new function() {
|
||||||
var _rndSeed;
|
var _rndSeed;
|
||||||
var _runningFlag = false;
|
var _runningFlag = false;
|
||||||
var _screenDiagInv;
|
var _screenDiagInv;
|
||||||
|
var _screenMode;
|
||||||
var _sourceImage = 0;
|
var _sourceImage = 0;
|
||||||
var _strokeDrawLength = null;
|
var _strokeDrawLength = null;
|
||||||
var _strokeDrawAngle = null;
|
var _strokeDrawAngle = null;
|
||||||
|
@ -776,7 +777,11 @@ var QB = new function() {
|
||||||
_images[_activeImage].dirty = true;
|
_images[_activeImage].dirty = true;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.clearRect(0, 0, _width(), _height());
|
ctx.clearRect(0, 0, _width(), _height());
|
||||||
|
//if (_screenMode == 1) { TODO: Finish implementing this.
|
||||||
ctx.fillStyle = color.rgba();
|
ctx.fillStyle = color.rgba();
|
||||||
|
//} else {
|
||||||
|
// ctx.fillStyle = color.rgba();
|
||||||
|
//}
|
||||||
ctx.fillRect(0, 0, _width(), _height());
|
ctx.fillRect(0, 0, _width(), _height());
|
||||||
|
|
||||||
// reset the text position
|
// reset the text position
|
||||||
|
@ -802,13 +807,24 @@ var QB = new function() {
|
||||||
return _rgb(0,0,0);
|
return _rgb(0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sub_Color = function(fg, bg) {
|
this.sub_Color = function(x, y) {
|
||||||
if (fg != undefined) {
|
/*if (_screenMode == 1) { This code is fine.
|
||||||
_fgColor = _color(fg);
|
if (x == 0) { _bgColor = _rgb(0, 0, 0);
|
||||||
|
} else if (x == 1) { _bgColor = _rgb(0, 0, 168);
|
||||||
|
} else if (x == 2) { _bgColor = _rgb(0, 168, 0);
|
||||||
|
} else if (x == 3) { _bgColor = _rgb(0, 168, 168); }
|
||||||
|
ctx = _images[_activeImage].ctx;
|
||||||
|
ctx.fillStyle = _bgColor.rgba();
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.fillRect(0, 0, _width(), _height());
|
||||||
|
} else {*/
|
||||||
|
if (x != undefined) {
|
||||||
|
_fgColor = _color(x);
|
||||||
}
|
}
|
||||||
if (bg != undefined) {
|
if (bg != undefined) {
|
||||||
_bgColor = _color(bg);
|
_bgColor = _color(y);
|
||||||
}
|
}
|
||||||
|
//}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.func_Command = function() {
|
this.func_Command = function() {
|
||||||
|
@ -1895,7 +1911,11 @@ var QB = new function() {
|
||||||
if (mode == 0) {
|
if (mode == 0) {
|
||||||
GX.sceneCreate(640, 400);
|
GX.sceneCreate(640, 400);
|
||||||
}
|
}
|
||||||
else if (mode < 2 || mode == 7 || mode == 13) {
|
else if (mode == 1) {
|
||||||
|
GX.sceneCreate(320, 200);
|
||||||
|
_fgColor = _rgb(168, 168, 168);
|
||||||
|
}
|
||||||
|
else if (mode == 2 || mode == 7 || mode == 13) {
|
||||||
GX.sceneCreate(320, 200);
|
GX.sceneCreate(320, 200);
|
||||||
}
|
}
|
||||||
else if (mode == 8) {
|
else if (mode == 8) {
|
||||||
|
@ -1921,13 +1941,14 @@ var QB = new function() {
|
||||||
_images[mode] = _images[0];
|
_images[mode] = _images[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_images[0] = { canvas: GX.canvas(), ctx: GX.ctx(), lastX: 0, lastY: 0};
|
_images[0] = { canvas: GX.canvas(), ctx: GX.ctx(), lastX: 0, lastY: 0 };
|
||||||
_images[0].lastX = _images[0].canvas.width/2;
|
_images[0].lastX = _images[0].canvas.width/2;
|
||||||
_images[0].lastY = _images[0].canvas.height/2;
|
_images[0].lastY = _images[0].canvas.height/2;
|
||||||
|
|
||||||
_screenDiagInv = 1/Math.sqrt(_images[0].canvas.width*_images[0].canvas.width + _images[0].canvas.height*_images[0].canvas.height);
|
_screenDiagInv = 1/Math.sqrt(_images[0].canvas.width*_images[0].canvas.width + _images[0].canvas.height*_images[0].canvas.height);
|
||||||
|
|
||||||
// initialize the graphics
|
// initialize the graphics
|
||||||
|
_screenMode = mode;
|
||||||
_fgColor = _color(7);
|
_fgColor = _color(7);
|
||||||
_bgColor = _color(0);
|
_bgColor = _color(0);
|
||||||
_locX = 0;
|
_locX = 0;
|
||||||
|
@ -1944,6 +1965,14 @@ var QB = new function() {
|
||||||
_keyHitBuffer = [];
|
_keyHitBuffer = [];
|
||||||
_keyDownMap = {};
|
_keyDownMap = {};
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (mode == 1) {
|
||||||
|
ctx = _images[_activeImage].ctx;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.fillStyle = _bgColor.rgba();
|
||||||
|
ctx.fillRect(0, 0, _width(), _height());
|
||||||
|
}
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
this.func_Sgn = function(value) {
|
this.func_Sgn = function(value) {
|
||||||
|
|
Loading…
Reference in a new issue