1
1
Fork 0
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:
William Barnes 2022-06-22 00:41:47 -04:00
parent 62153b8001
commit a7a0fbedbb

41
qb.js
View file

@ -34,6 +34,7 @@ var QB = new function() {
var _rndSeed;
var _runningFlag = false;
var _screenDiagInv;
var _screenMode;
var _sourceImage = 0;
var _strokeDrawLength = null;
var _strokeDrawAngle = null;
@ -776,7 +777,11 @@ var QB = new function() {
_images[_activeImage].dirty = true;
ctx.beginPath();
ctx.clearRect(0, 0, _width(), _height());
//if (_screenMode == 1) { TODO: Finish implementing this.
ctx.fillStyle = color.rgba();
//} else {
// ctx.fillStyle = color.rgba();
//}
ctx.fillRect(0, 0, _width(), _height());
// reset the text position
@ -802,13 +807,24 @@ var QB = new function() {
return _rgb(0,0,0);
}
this.sub_Color = function(fg, bg) {
if (fg != undefined) {
_fgColor = _color(fg);
this.sub_Color = function(x, y) {
/*if (_screenMode == 1) { This code is fine.
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) {
_bgColor = _color(bg);
_bgColor = _color(y);
}
//}
};
this.func_Command = function() {
@ -1895,7 +1911,11 @@ var QB = new function() {
if (mode == 0) {
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);
}
else if (mode == 8) {
@ -1921,13 +1941,14 @@ var QB = new function() {
_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].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);
// initialize the graphics
_screenMode = mode;
_fgColor = _color(7);
_bgColor = _color(0);
_locX = 0;
@ -1944,6 +1965,14 @@ var QB = new function() {
_keyHitBuffer = [];
_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) {