User prompt
Make the screen go up with the scroll up button and down the the scroll down button
User prompt
Make it go a tinny tiny bit up and down with the button.
User prompt
Make the buttons scroll
User prompt
Make it on the first screen you see
User prompt
Add the scroll button too the home and not the blue screen
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'setTimeout(function () {' Line Number: 379
User prompt
Add it next too the buttons
User prompt
There's a button that say scroll up the scrolls up and a buttons that says scroll down that scrolls down
User prompt
Add a red scroll bar visible for a phones size
User prompt
Make the buttons small with the text still in the box
User prompt
Make windows 2.0
User prompt
Make them close to the buttons
User prompt
Make arrows down and up and if you press the up it goes up a tiny bit same with down but it goes down and the arrows are red
User prompt
The scroll is red
User prompt
Make a scroll bar that is on the right it's no wide and if you scroll down it goes down same thing with up
User prompt
Make it so you can scroll with you finger
User prompt
Add windows 1.0
User prompt
Add windows nt
User prompt
Add windows 98 next too windows 95
User prompt
Add unrealeast versions
User prompt
Now there's more buttons that say Windows versions and if you press that you see windows versions and if you press it it shows blue screens of those windows versions
/****
* Classes
****/
// No plugins needed for this game
// Button class: a simple rectangular button with centered text
var BlueButton = Container.expand(function () {
var self = Container.call(this);
// Button dimensions
var btnWidth = 600;
var btnHeight = 200;
// Create button background (rounded rectangle using ellipse for corners)
var btnBg = self.attachAsset('buttonBg', {
width: btnWidth,
height: btnHeight,
color: 0x1e90ff,
// Dodger blue
shape: 'box',
anchorX: 0.5,
anchorY: 0.5
});
// Button label
var btnLabel = new Text2('PRESS ME', {
size: 90,
fill: 0xFFFFFF
});
btnLabel.anchor.set(0.5, 0.5);
btnLabel.x = 0;
btnLabel.y = 0;
self.addChild(btnLabel);
// Optional: visual feedback on press
self.down = function (x, y, obj) {
btnBg.alpha = 0.7;
};
self.up = function (x, y, obj) {
btnBg.alpha = 1;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xffffff // Start with white background
});
/****
* Game Code
****/
// Set initial background color (white)
game.setBackgroundColor(0xffffff);
// --- Windows Version Data ---
var windowsVersions = [{
name: "Windows 1.0",
color: 0x0000aa,
face: "",
text: "Unexpected system error.\n\nPlease restart your computer.\n\nPress any key to continue _",
textSize: 60
},
// --- Windows 2.0 ---
{
name: "Windows 2.0",
color: 0x0000aa,
face: "",
text: "System Error\n\nAn error has occurred in Windows 2.0.\n\nPlease restart your computer by pressing CTRL+ALT+DEL.\n\nPress any key to continue _",
textSize: 60
}, {
name: "Windows 95",
color: 0x0000aa,
face: "",
text: "A fatal exception 0E has occurred at 0028:C0011E36 in VXD VMM(01) +\n00010E36. The current application will be terminated.\n\n* Press any key to terminate the current application.\n* Press CTRL+ALT+DEL again to restart your computer. You will\n lose any unsaved information in all applications.\n\nPress any key to continue _",
textSize: 60
}, {
name: "Windows 98",
color: 0x0000aa,
face: "",
text: "A fatal exception 0E has occurred at 0028:C183:00000000 in VXD VMM(01) +\n00000000. The current application will be terminated.\n\n* Press any key to terminate the current application.\n* Press CTRL+ALT+DEL again to restart your computer. You will\n lose any unsaved information in all applications.\n\nPress any key to continue _",
textSize: 60
}, {
name: "Windows NT",
color: 0x000080,
face: "",
text: "*** STOP: 0x0000001E (0xC0000005,0x00000000,0x00000000,0x00000000)\nKMODE_EXCEPTION_NOT_HANDLED\n\nIf this is the first time you've seen this Stop error screen,\nrestart your computer. If this screen appears again, follow\nthese steps:\n\nCheck to make sure any new hardware or software is properly installed.\nIf this is a new installation, ask your hardware or software manufacturer\nfor any Windows NT updates you might need.\n\nIf problems continue, disable or remove any newly installed hardware\nor software. Disable BIOS memory options such as caching or shadowing.\nIf you need to use Safe Mode to remove or disable components, restart\nyour computer, press F8 to select Advanced Startup Options, and then\nselect Safe Mode.",
textSize: 48
}, {
name: "Windows XP",
color: 0x00008b,
face: "",
text: "A problem has been detected and Windows has been shut down to prevent damage\nto your computer.\n\nIf this is the first time you've seen this Stop error screen,\nrestart your computer. If this screen appears again, follow\nthese steps:\n\nCheck to make sure any new hardware or software is properly installed.\nIf this is a new installation, ask your hardware or software manufacturer\nfor any Windows updates you might need.\n\nIf problems continue, disable or remove any newly installed hardware\nor software. Disable BIOS memory options such as caching or shadowing.\nIf you need to use Safe Mode to remove or disable components, restart\nyour computer, press F8 to select Advanced Startup Options, and then\nselect Safe Mode.\n\nTechnical information:\n*** STOP: 0x0000007B (0xF78D2524,0xC0000034,0x00000000,0x00000000)",
textSize: 48
}, {
name: "Windows 7",
color: 0x0000aa,
face: "",
text: "A problem has been detected and Windows has been shut down to prevent damage\nto your computer.\n\nIf this is the first time you've seen this Stop error screen,\nrestart your computer. If this screen appears again, follow\nthese steps:\n\nCheck to make sure any new hardware or software is properly installed.\nIf this is a new installation, ask your hardware or software manufacturer\nfor any Windows updates you might need.\n\nIf problems continue, disable or remove any newly installed hardware\nor software. Disable BIOS memory options such as caching or shadowing.\nIf you need to use Safe Mode to remove or disable components, restart\nyour computer, press F8 to select Advanced Startup Options, and then\nselect Safe Mode.\n\nTechnical information:\n*** STOP: 0x0000007E (0xFFFFFFFFC0000005,0xFFFFF80002F8A16A,0xFFFFF880009A8C28,0xFFFFF880009A8480)",
textSize: 48
}, {
name: "Windows 10",
color: 0x0078d7,
face: ":(",
text: "Your PC ran into a problem and needs to restart.\nWe're just collecting some error info, and then we'll restart for you.\n\nFor more information about this issue and possible fixes, visit\nhttps://www.windows.com/stopcode\n\nIf you call a support person, give them this info:\nSTOP CODE: FRVR_GAME_CRASHED",
textSize: 60
}, {
name: "Windows 11",
color: 0x003399,
face: ":(",
text: "Your device ran into a problem and needs to restart.\nWe're just collecting some error info, and then we'll restart for you.\n\nFor more information about this issue and possible fixes, visit\nhttps://www.windows.com/stopcode\n\nIf you call a support person, give them this info:\nSTOP CODE: FRVR_GAME_CRASHED",
textSize: 60
},
// Unreleased versions
{
name: "Windows 12 (Unreleased)",
color: 0x2222cc,
face: ":(",
text: "Your device ran into a problem and needs to restart.\nWe're just collecting some error info, and then we'll restart for you.\n\nFor more information about this issue and possible fixes, visit\nhttps://www.windows.com/stopcode\n\nIf you call a support person, give them this info:\nSTOP CODE: FRVR_UNRELEASED_BUILD",
textSize: 60
}, {
name: "Windows Neptune (Unreleased)",
color: 0x003366,
face: "",
text: "A problem has been detected and Windows Neptune has been shut down to prevent damage\nto your computer.\n\nIf this is the first time you've seen this Stop error screen,\nrestart your computer. If this screen appears again, follow\nthese steps:\n\nCheck to make sure any new hardware or software is properly installed.\nIf this is a new installation, ask your hardware or software manufacturer\nfor any Windows updates you might need.\n\nTechnical information:\n*** STOP: 0x0000007E (0xFFFFFFFFC0000005,0xFFFFF80002F8A16A,0xFFFFF880009A8C28,0xFFFFF880009A8480)",
textSize: 48
}, {
name: "Windows Longhorn (Unreleased)",
color: 0x004488,
face: "",
text: "A problem has been detected and Windows Longhorn has been shut down to prevent damage\nto your computer.\n\nIf this is the first time you've seen this Stop error screen,\nrestart your computer. If this screen appears again, follow\nthese steps:\n\nCheck to make sure any new hardware or software is properly installed.\nIf this is a new installation, ask your hardware or software manufacturer\nfor any Windows updates you might need.\n\nTechnical information:\n*** STOP: 0xDEADDEAD (0x00000000,0x00000000,0x00000000,0x00000000)",
textSize: 48
}];
// --- UI State ---
var versionButtons = [];
var versionSelectButtons = [];
var selectedVersionIdx = null;
// --- Helper: Remove all children except version buttons ---
function clearScreenExceptVersionBtns() {
for (var i = game.children.length - 1; i >= 0; i--) {
var child = game.children[i];
if (versionButtons.indexOf(child) === -1 && versionSelectButtons.indexOf(child) === -1) {
child.destroy();
}
}
}
// --- Step 1: Show version selection buttons ---
function showVersionButtons() {
// Remove any previous version select buttons
for (var i = 0; i < versionSelectButtons.length; ++i) {
versionSelectButtons[i].destroy();
}
versionSelectButtons = [];
// Remove any blue screen or other overlays
clearScreenExceptVersionBtns();
// Remove old version buttons
for (var i = 0; i < versionButtons.length; ++i) {
versionButtons[i].destroy();
}
versionButtons = [];
// Layout: vertical stack, centered
var btnW = 700,
btnH = 200,
spacing = 60;
var totalH = windowsVersions.length * btnH + (windowsVersions.length - 1) * spacing;
var startY = (2732 - totalH) / 2 + btnH / 2;
for (var i = 0; i < windowsVersions.length; ++i) {
(function (idx) {
var btn = new BlueButton();
btn.setLabel(windowsVersions[idx].name);
btn.x = 2048 / 2;
btn.y = startY + i * (btnH + spacing);
btn.visible = true;
btn.alpha = 1;
btn.up = function (x, y, obj) {
showVersionSelect(idx);
};
game.addChild(btn);
versionButtons.push(btn);
})(i);
}
}
// --- Step 2: Show "See Blue Screen" button for selected version ---
function showVersionSelect(idx) {
// Remove version buttons
for (var i = 0; i < versionButtons.length; ++i) {
versionButtons[i].destroy();
}
versionButtons = [];
// Remove any previous select buttons
for (var i = 0; i < versionSelectButtons.length; ++i) {
versionSelectButtons[i].destroy();
}
versionSelectButtons = [];
clearScreenExceptVersionBtns();
selectedVersionIdx = idx;
var version = windowsVersions[idx];
// Show version name as title
var title = new Text2(version.name, {
size: 120,
fill: 0x222222
});
title.anchor.set(0.5, 0.5);
title.x = 2048 / 2;
title.y = 2732 / 2 - 300;
game.addChild(title);
versionSelectButtons.push(title);
// Show "See Blue Screen" button
var seeBtn = new BlueButton();
seeBtn.setLabel("See Blue Screen");
seeBtn.x = 2048 / 2;
seeBtn.y = 2732 / 2 + 100;
seeBtn.visible = true;
seeBtn.alpha = 1;
seeBtn.up = function (x, y, obj) {
showBlueScreen(idx);
};
game.addChild(seeBtn);
versionSelectButtons.push(seeBtn);
// Show "Back" button
var backBtn = new BlueButton();
backBtn.setLabel("Back");
backBtn.x = 2048 / 2;
backBtn.y = 2732 / 2 + 350;
backBtn.visible = true;
backBtn.alpha = 1;
backBtn.up = function (x, y, obj) {
showVersionButtons();
};
game.addChild(backBtn);
versionSelectButtons.push(backBtn);
}
// --- Step 3: Show blue screen for selected version ---
function showBlueScreen(idx) {
// Remove all UI
for (var i = 0; i < versionButtons.length; ++i) {
versionButtons[i].destroy();
}
versionButtons = [];
for (var i = 0; i < versionSelectButtons.length; ++i) {
versionSelectButtons[i].destroy();
}
versionSelectButtons = [];
clearScreenExceptVersionBtns();
var version = windowsVersions[idx];
// Set background color
game.setBackgroundColor(version.color);
// Show sad face if present
if (version.face) {
var sadFace = new Text2(version.face, {
size: 400,
fill: 0xFFFFFF
});
sadFace.anchor.set(0.5, 0.5);
sadFace.x = 2048 / 2;
sadFace.y = 2732 / 2 - 350;
game.addChild(sadFace);
}
// Create a scrollable container for the blue screen text
var scrollContainer = new Container();
scrollContainer.x = 0;
scrollContainer.y = 0;
game.addChild(scrollContainer);
// Show blue screen text inside the scrollable container
var bsodText = new Text2(version.text, {
size: version.textSize,
fill: 0xFFFFFF,
align: "center"
});
bsodText.anchor.set(0.5, 0);
bsodText.x = 2048 / 2;
bsodText.y = 2732 / 2 + 50;
scrollContainer.addChild(bsodText);
// --- Scroll Bar Setup ---
// Make scroll bar much larger for phone screens
var scrollBarW = 80;
var scrollBarH = 1200; // Will be resized dynamically
var scrollBarX = 2048 - scrollBarW - 32;
var scrollBarY = 2732 / 2 + 50;
var scrollBarTrack = new Container();
var scrollBarBg = LK.getAsset('buttonBg', {
width: scrollBarW,
height: 2000,
color: 0x222244,
anchorX: 0.5,
anchorY: 0
});
scrollBarBg.x = scrollBarW / 2;
scrollBarBg.y = 0;
scrollBarTrack.addChild(scrollBarBg);
scrollBarTrack.x = scrollBarX;
scrollBarTrack.y = scrollBarY;
game.addChild(scrollBarTrack);
var scrollBarThumb = LK.getAsset('buttonBg', {
width: scrollBarW - 12,
height: 400,
color: 0xff2222,
// red
anchorX: 0.5,
anchorY: 0
});
scrollBarThumb.x = scrollBarW / 2;
scrollBarThumb.y = 0;
scrollBarTrack.addChild(scrollBarThumb);
// Set up scrolling state
var scrollStartY = null;
var scrollLastY = null;
var scrollOffsetY = 0;
var scrollMinY = Math.min(0, 2732 - (bsodText.y + bsodText.height + 100));
var scrollMaxY = 0;
// --- Helper to update scroll bar thumb position and size ---
function updateScrollBar() {
// Visible area height
var visibleH = 2732 - (2732 / 2 + 50) - 250 - 60; // from bsodText.y to backBtn.y, minus some margin
var contentH = bsodText.height;
var scrollAreaH = visibleH;
// If content fits, hide scrollbar
if (contentH <= visibleH) {
scrollBarTrack.visible = false;
return;
}
scrollBarTrack.visible = true;
// Track height
scrollBarBg.height = scrollAreaH;
scrollBarTrack.y = bsodText.y;
// Thumb height (bigger minimum for phone)
var thumbH = Math.max(200, scrollAreaH * (visibleH / contentH));
scrollBarThumb.height = thumbH;
// Thumb position
var scrollRange = scrollMinY - scrollMaxY;
var scrollPos = (scrollOffsetY - scrollMaxY) / (scrollMinY - scrollMaxY);
if (isNaN(scrollPos)) scrollPos = 0;
if (scrollPos < 0) scrollPos = 0;
if (scrollPos > 1) scrollPos = 1;
scrollBarThumb.y = (scrollAreaH - thumbH) * scrollPos;
}
// Touch/mouse down to start scroll
scrollContainer.down = function (x, y, obj) {
scrollStartY = y;
scrollLastY = y;
};
// Touch/mouse move to scroll
scrollContainer.move = function (x, y, obj) {
if (scrollStartY !== null) {
var deltaY = y - scrollLastY;
scrollOffsetY += deltaY;
// Clamp scroll
if (scrollOffsetY < scrollMinY) scrollOffsetY = scrollMinY;
if (scrollOffsetY > scrollMaxY) scrollOffsetY = scrollMaxY;
bsodText.y = 2732 / 2 + 50 + scrollOffsetY;
scrollLastY = y;
updateScrollBar();
}
};
// Touch/mouse up to end scroll
scrollContainer.up = function (x, y, obj) {
scrollStartY = null;
scrollLastY = null;
updateScrollBar();
};
// Initial update of scroll bar after layout
setTimeout(function () {
updateScrollBar();
}, 0);
// Forward game move/down/up events to scrollContainer if inside text area
var origGameDown = game.down;
var origGameMove = game.move;
var origGameUp = game.up;
game.down = function (x, y, obj) {
// Only allow scroll if inside bsodText area
var local = bsodText.toLocal({
x: x,
y: y
}, game);
if (x >= bsodText.x - bsodText.width / 2 && x <= bsodText.x + bsodText.width / 2 && y >= bsodText.y && y <= bsodText.y + bsodText.height) {
if (scrollContainer.down) scrollContainer.down(x, y, obj);
} else if (origGameDown) {
origGameDown(x, y, obj);
}
};
game.move = function (x, y, obj) {
if (scrollStartY !== null) {
if (scrollContainer.move) scrollContainer.move(x, y, obj);
} else if (origGameMove) {
origGameMove(x, y, obj);
}
};
game.up = function (x, y, obj) {
if (scrollStartY !== null) {
if (scrollContainer.up) scrollContainer.up(x, y, obj);
} else if (origGameUp) {
origGameUp(x, y, obj);
}
};
// --- Scroll Up/Down Buttons for Scrolling ---
// Button dimensions and positions (bigger for phone)
var scrollBtnW = 340;
var scrollBtnH = 120;
var scrollBtnX = scrollBarX + scrollBarW / 2;
var upBtnY = scrollBarTrack.y - scrollBtnH / 2 - 16;
var downBtnY = scrollBarTrack.y + scrollBarBg.height + scrollBtnH / 2 + 16;
// Helper to create a red button with label
function createScrollBtn(label) {
var btn = new Container();
var bg = LK.getAsset('buttonBg', {
width: scrollBtnW,
height: scrollBtnH,
color: 0xff2222,
anchorX: 0.5,
anchorY: 0.5
});
btn.addChild(bg);
var txt = new Text2(label, {
size: 48,
fill: 0xffffff
});
txt.anchor.set(0.5, 0.5);
txt.x = 0;
txt.y = 0;
btn.addChild(txt);
btn.down = function () {
bg.alpha = 0.7;
};
btn.up = function () {
bg.alpha = 1;
};
return btn;
}
// Scroll Up button
var scrollUpBtn = createScrollBtn("Scroll Up");
scrollUpBtn.x = scrollBtnX;
scrollUpBtn.y = upBtnY;
scrollUpBtn.up = function (x, y, obj) {
// Scroll up a small amount
scrollOffsetY += 80;
if (scrollOffsetY > scrollMaxY) scrollOffsetY = scrollMaxY;
bsodText.y = 2732 / 2 + 50 + scrollOffsetY;
updateScrollBar();
};
game.addChild(scrollUpBtn);
versionSelectButtons.push(scrollUpBtn);
// Scroll Down button
var scrollDownBtn = createScrollBtn("Scroll Down");
scrollDownBtn.x = scrollBtnX;
scrollDownBtn.y = downBtnY;
scrollDownBtn.up = function (x, y, obj) {
// Scroll down a small amount
scrollOffsetY -= 80;
if (scrollOffsetY < scrollMinY) scrollOffsetY = scrollMinY;
bsodText.y = 2732 / 2 + 50 + scrollOffsetY;
updateScrollBar();
};
game.addChild(scrollDownBtn);
versionSelectButtons.push(scrollDownBtn);
// Show "Back" button to return to version select
var backBtn = new BlueButton();
backBtn.setLabel("Back");
backBtn.x = 2048 / 2;
backBtn.y = 2732 - 250;
backBtn.visible = true;
backBtn.alpha = 1;
backBtn.up = function (x, y, obj) {
showVersionSelect(idx);
};
game.addChild(backBtn);
versionSelectButtons.push(backBtn);
}
// --- BlueButton: add setLabel method ---
BlueButton.prototype.setLabel = function (txt) {
// Find the Text2 child and set its text
for (var i = 0; i < this.children.length; ++i) {
if (this.children[i] instanceof Text2) {
this.children[i].setText(txt);
break;
}
}
};
// --- Start the UI ---
showVersionButtons();
// No update loop or other game logic needed for this MVP
// No GUI elements needed
// No sounds, music, or other effects per requirements; ===================================================================
--- original.js
+++ change.js
@@ -387,72 +387,68 @@
} else if (origGameUp) {
origGameUp(x, y, obj);
}
};
- // --- Arrow Buttons for Scrolling ---
- // Arrow button dimensions and positions (bigger for phone)
- var arrowBtnW = 120;
- var arrowBtnH = 120;
- // Move arrows closer to the scroll bar: align X to center of scroll bar, and Y just above/below the scroll bar track
- var arrowBtnX = scrollBarX + scrollBarW / 2;
- var upArrowY = scrollBarTrack.y - arrowBtnH / 2 - 16;
- var downArrowY = scrollBarTrack.y + scrollBarBg.height + arrowBtnH / 2 + 16;
- // Helper to create a red arrow button (direction: "up" or "down")
- function createArrowBtn(direction) {
+ // --- Scroll Up/Down Buttons for Scrolling ---
+ // Button dimensions and positions (bigger for phone)
+ var scrollBtnW = 340;
+ var scrollBtnH = 120;
+ var scrollBtnX = scrollBarX + scrollBarW / 2;
+ var upBtnY = scrollBarTrack.y - scrollBtnH / 2 - 16;
+ var downBtnY = scrollBarTrack.y + scrollBarBg.height + scrollBtnH / 2 + 16;
+ // Helper to create a red button with label
+ function createScrollBtn(label) {
var btn = new Container();
- // Red background
var bg = LK.getAsset('buttonBg', {
- width: arrowBtnW,
- height: arrowBtnH,
+ width: scrollBtnW,
+ height: scrollBtnH,
color: 0xff2222,
anchorX: 0.5,
anchorY: 0.5
});
btn.addChild(bg);
- // Arrow symbol
- var arrowTxt = new Text2(direction === "up" ? "▲" : "▼", {
- size: 44,
+ var txt = new Text2(label, {
+ size: 48,
fill: 0xffffff
});
- arrowTxt.anchor.set(0.5, 0.5);
- arrowTxt.x = 0;
- arrowTxt.y = 0;
- btn.addChild(arrowTxt);
- // Visual feedback
+ txt.anchor.set(0.5, 0.5);
+ txt.x = 0;
+ txt.y = 0;
+ btn.addChild(txt);
btn.down = function () {
bg.alpha = 0.7;
};
btn.up = function () {
bg.alpha = 1;
};
return btn;
}
- // Up arrow
- var upArrowBtn = createArrowBtn("up");
- upArrowBtn.x = arrowBtnX;
- upArrowBtn.y = upArrowY;
- upArrowBtn.up = function (x, y, obj) {
+ // Scroll Up button
+ var scrollUpBtn = createScrollBtn("Scroll Up");
+ scrollUpBtn.x = scrollBtnX;
+ scrollUpBtn.y = upBtnY;
+ scrollUpBtn.up = function (x, y, obj) {
// Scroll up a small amount
scrollOffsetY += 80;
if (scrollOffsetY > scrollMaxY) scrollOffsetY = scrollMaxY;
bsodText.y = 2732 / 2 + 50 + scrollOffsetY;
updateScrollBar();
};
- game.addChild(upArrowBtn);
- versionSelectButtons.push(upArrowBtn);
- // Down arrow
- var downArrowBtn = createArrowBtn("down");
- downArrowBtn.x = arrowBtnX;
- downArrowBtn.y = downArrowY;
- downArrowBtn.up = function (x, y, obj) {
+ game.addChild(scrollUpBtn);
+ versionSelectButtons.push(scrollUpBtn);
+ // Scroll Down button
+ var scrollDownBtn = createScrollBtn("Scroll Down");
+ scrollDownBtn.x = scrollBtnX;
+ scrollDownBtn.y = downBtnY;
+ scrollDownBtn.up = function (x, y, obj) {
// Scroll down a small amount
scrollOffsetY -= 80;
if (scrollOffsetY < scrollMinY) scrollOffsetY = scrollMinY;
bsodText.y = 2732 / 2 + 50 + scrollOffsetY;
updateScrollBar();
};
- game.addChild(downArrowBtn);
- versionSelectButtons.push(downArrowBtn);
+ game.addChild(scrollDownBtn);
+ versionSelectButtons.push(scrollDownBtn);
// Show "Back" button to return to version select
var backBtn = new BlueButton();
backBtn.setLabel("Back");
backBtn.x = 2048 / 2;