diff --git a/build_files/JavaScript/Engine/Simple function handlers/changeSpriteValues.js b/build_files/JavaScript/Engine/Simple function handlers/changeSpriteValues.js index 550cb8b..10a201c 100644 --- a/build_files/JavaScript/Engine/Simple function handlers/changeSpriteValues.js +++ b/build_files/JavaScript/Engine/Simple function handlers/changeSpriteValues.js @@ -1,166 +1,2 @@ -// Attach input event listeners -document.getElementById('spriteXInput').addEventListener('input', updateSpriteX); -document.getElementById('spriteYInput').addEventListener('input', updateSpriteY); -document.getElementById('spriteWidthInput').addEventListener('input', updateSpriteWidth); -document.getElementById('spriteHeightInput').addEventListener('input', updateSpriteHeight); - -function updateSpriteX() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - const newX = parseFloat(document.getElementById('spriteXInput').value); - sprite.x(newX); - sprite.getLayer().draw(); - } - } -} - -function updateSpriteY() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - const newY = parseFloat(document.getElementById('spriteYInput').value); - sprite.y(newY); - sprite.getLayer().draw(); - } - } -} - -function updateSpriteWidth() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - const newWidth = parseFloat(document.getElementById('spriteWidthInput').value); - sprite.width(newWidth); - sprite.offsetX(newWidth / 2); - sprite.getLayer().batchDraw(); - } - } -} - -function updateSpriteHeight() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - const newHeight = parseFloat(document.getElementById('spriteHeightInput').value); - sprite.height(newHeight); - sprite.offsetY(newHeight / 2); - sprite.getLayer().batchDraw(); - } - } -} - -function moveSpriteUp() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - const layer = sprite.getLayer(); - if (layer) { - const children = layer.getChildren(); - const currentZIndex = sprite.zIndex(); - if (currentZIndex < children.length - 1) { - sprite.zIndex(currentZIndex + 1); // Move up - layer.batchDraw(); // Redraw the layer - } - } - } - } -} - -function moveSpriteDown() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - const layer = sprite.getLayer(); - if (layer) { - const currentZIndex = sprite.zIndex(); - if (currentZIndex > 0) { - sprite.zIndex(currentZIndex - 1); // Move down - layer.batchDraw(); // Redraw the layer - } - } - } - } -} - -document.getElementById('moveSpriteUp').addEventListener('click', moveSpriteUp); -document.getElementById('moveSpriteDown').addEventListener('click', moveSpriteDown); - -// Function to change X value input to sprite's X position -function changeXvalueInputToSprite() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - document.getElementById('spriteXInput').value = sprite.x(); - } - } -} - -// Function to change Y value input to sprite's Y position -function changeYvalueInputToSprite() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - document.getElementById('spriteYInput').value = sprite.y(); - } - } -} - -// Function to change width and height inputs to sprite's current width and height -function changeSizeInputsToSprite() { - if (selectedId) { - const sprite = stage.findOne(`#${selectedId}`); - if (sprite) { - document.getElementById('spriteWidthInput').value = sprite.width(); - document.getElementById('spriteHeightInput').value = sprite.height(); - } - } -} - -// Update all input values to reflect current sprite properties -function updateAllValues() { - if (selectedId !== null) { - changeSelectedObjectText(); - changeXvalueInputToSprite(); - changeYvalueInputToSprite(); - changeSizeInputsToSprite(); // Include size updates - } else { - // If no sprite is selected, set all inputs to 0 - document.getElementById('spriteXInput').value = 0; - document.getElementById('spriteYInput').value = 0; - document.getElementById('spriteWidthInput').value = 0; - document.getElementById('spriteHeightInput').value = 0; - - changeSelectedObjectText(); // Update the text for no selection case - } -} - -// Function to change selected object text -function changeSelectedObjectText() { - const selectedImageShowerText = document.getElementById('selectedSpriteShower'); - if (selectedId !== null) { - selectedImageShowerText.style.color = 'green'; - selectedImageShowerText.textContent = 'An Object Selected!'; - } else { - selectedImageShowerText.style.color = 'red'; - selectedImageShowerText.textContent = 'No Object Selected!'; - } -} - -// Initialization -document.addEventListener('DOMContentLoaded', () => { - changeSelectedObjectText(); - initializeKonva(); // Assume this initializes your Konva stage and layers - - // Add a click listener to the stage to handle clicks on empty space - const canvas = document.querySelector('.gameCanvas'); - stage = canvas.__konvaStage; // Ensure 'stage' is properly assigned - if (stage) { - stage.on('click', function(e) { - // Deselect if the click was on empty space - if (e.target === stage) { - deselectImage(); - } - }); - } -}); \ No newline at end of file +function updateSpriteX(){if(selectedId){let e=stage.findOne(`#${selectedId}`);if(e){let t=parseFloat(document.getElementById("spriteXInput").value);e.x(t),e.getLayer().draw()}}}function updateSpriteY(){if(selectedId){let e=stage.findOne(`#${selectedId}`);if(e){let t=parseFloat(document.getElementById("spriteYInput").value);e.y(t),e.getLayer().draw()}}}function updateSpriteWidth(){if(selectedId){let e=stage.findOne(`#${selectedId}`);if(e){let t=parseFloat(document.getElementById("spriteWidthInput").value);e.width(t),e.offsetX(t/2),e.getLayer().batchDraw()}}}function updateSpriteHeight(){if(selectedId){let e=stage.findOne(`#${selectedId}`);if(e){let t=parseFloat(document.getElementById("spriteHeightInput").value);e.height(t),e.offsetY(t/2),e.getLayer().batchDraw()}}}function moveSpriteUp(){if(selectedId){let e=stage.findOne(`#${selectedId}`);if(e){let t=e.getLayer();if(t){let n=t.getChildren(),i=e.zIndex();i0&&(e.zIndex(n-1),t.batchDraw())}}}}function changeXvalueInputToSprite(){if(selectedId){let e=stage.findOne(`#${selectedId}`);e&&(document.getElementById("spriteXInput").value=e.x())}}function changeYvalueInputToSprite(){if(selectedId){let e=stage.findOne(`#${selectedId}`);e&&(document.getElementById("spriteYInput").value=e.y())}}function changeSizeInputsToSprite(){if(selectedId){let e=stage.findOne(`#${selectedId}`);e&&(document.getElementById("spriteWidthInput").value=e.width(),document.getElementById("spriteHeightInput").value=e.height())}}function updateAllValues(){null!==selectedId?(changeSelectedObjectText(),changeXvalueInputToSprite(),changeYvalueInputToSprite(),changeSizeInputsToSprite()):(document.getElementById("spriteXInput").value=0,document.getElementById("spriteYInput").value=0,document.getElementById("spriteWidthInput").value=0,document.getElementById("spriteHeightInput").value=0,changeSelectedObjectText())}function changeSelectedObjectText(){let e=document.getElementById("selectedSpriteShower");null!==selectedId?(e.style.color="green",e.textContent="An Object Selected!"):(e.style.color="red",e.textContent="No Object Selected!")}document.getElementById("spriteXInput").addEventListener("input",updateSpriteX),document.getElementById("spriteYInput").addEventListener("input",updateSpriteY),document.getElementById("spriteWidthInput").addEventListener("input",updateSpriteWidth),document.getElementById("spriteHeightInput").addEventListener("input",updateSpriteHeight),document.getElementById("moveSpriteUp").addEventListener("click",moveSpriteUp),document.getElementById("moveSpriteDown").addEventListener("click",moveSpriteDown),document.addEventListener("DOMContentLoaded",()=>{changeSelectedObjectText(),initializeKonva();let e=document.querySelector(".gameCanvas");(stage=e.__konvaStage)&&stage.on("click",function(e){e.target===stage&&deselectImage()})}); +// minified to keep lightweighed \ No newline at end of file diff --git a/build_files/JavaScript/Engine/engineFunction.js b/build_files/JavaScript/Engine/engineFunction.js index 3815b30..d4b020f 100644 --- a/build_files/JavaScript/Engine/engineFunction.js +++ b/build_files/JavaScript/Engine/engineFunction.js @@ -290,4 +290,4 @@ document.addEventListener('DOMContentLoaded', () => { } }); } -}); +}); \ No newline at end of file diff --git a/build_files/html/Engine/BlockyEditor.html b/build_files/html/Engine/BlockyEditor.html index 9c37c78..b107920 100644 --- a/build_files/html/Engine/BlockyEditor.html +++ b/build_files/html/Engine/BlockyEditor.html @@ -1,67 +1 @@ - - - - - - - - - - Blockly Visual Editor - - - - -
- - - \ No newline at end of file +Blockly Visual Editor
\ No newline at end of file diff --git a/build_files/html/Engine/Engine.html b/build_files/html/Engine/Engine.html index 8279019..e9e3671 100644 --- a/build_files/html/Engine/Engine.html +++ b/build_files/html/Engine/Engine.html @@ -9,6 +9,7 @@ LiteForge Evo + @@ -20,6 +21,9 @@ // For storing selected sprites let selectedId = null; + + // For storing sprite frames + let engineState; diff --git a/build_files/html/Engine/PreviewGame.html b/build_files/html/Engine/PreviewGame.html index dcbe302..da45854 100644 --- a/build_files/html/Engine/PreviewGame.html +++ b/build_files/html/Engine/PreviewGame.html @@ -5,6 +5,7 @@ Preview Game +

DVD Animation - 1st Animation Made

Back to Engine + + \ No newline at end of file diff --git a/build_files/html/mainMenu.html b/build_files/html/mainMenu.html index 33c116f..82fa1b4 100644 --- a/build_files/html/mainMenu.html +++ b/build_files/html/mainMenu.html @@ -4,9 +4,15 @@ LiteForge Evo + @@ -214,6 +254,12 @@

MENU

@@ -228,22 +274,16 @@

Create New Project

function createClicked() { document.getElementById('layout-1').style.display = 'none'; document.getElementById('layout-2').style.display = 'block'; - document.body.classList.remove('layout-1'); - document.body.classList.add('layout-2'); } function infoClicked() { document.getElementById('layout-2').style.display = 'none'; document.getElementById('layout-1').style.display = 'block'; - document.body.classList.remove('layout-2'); - document.body.classList.add('layout-1'); } document.addEventListener('DOMContentLoaded', function() { document.getElementById('layout-1').style.display = 'block'; document.getElementById('layout-2').style.display = 'none'; - document.body.classList.remove('layout-2'); - document.body.classList.add('layout-1'); }); function newProject() { @@ -257,15 +297,15 @@

Create New Project

diff --git a/icon/LFE_logo.png b/icon/LFE_logo.png new file mode 100644 index 0000000..7c38c2b Binary files /dev/null and b/icon/LFE_logo.png differ diff --git a/index.html b/index.html index df2fdad..6629bdc 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ LiteForge Evo +