Mine is javascript, but you can add PHP!
Offline
rdococ wrote:
GP1 wrote:
rdococ wrote:
I've updated my code snippet, with a bit of CSS to decorate the page.
(outdated code was here)
See the new CSS code! But the second sprite code doesn't work anymore?
I'll update it again.Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <h2>Go Everywhere Snippet</h2></head><body> <style type="text/css"> body { background-color:#f1f1f1; } h1 { color:black; text-align:center; } p { font-family:"Arial"; font-size:10px; } </style> <br> <form name="data"> <canvas id="stage" width="120" height="120" style="border: 0px solid rgb(0, 0, 0);">Cannot display project! Please switch to a browser with canvas support. </canvas><br> <script type="text/javascript"> function updateStageInToFin() { var c=document.getElementById("stage"); var cxt=c.getContext("2d"); cxt.fillStyle="#F1F1F1"; cxt.fillRect(0,0,10000,10000); cxt.fillStyle="#FFFFFF"; cxt.fillRect(0,0,120,120); cxt.fillStyle=document.data.sprite1c.value; cxt.beginPath(); cxt.arc(document.data.sprite1x.value,document.data.sprite1y.value,document.data.sprite1s.value,document.data.sprite1s.value,Math.PI*2,true); cxt.closePath(); cxt.fill(); } </script> <p> Sprite1 X:<input name="sprite1x" value="15" type="text"> pixels<br> Sprite1 Y:<input name="sprite1y" value="15" type="text"> pixels<br> Sprite1 size:<input name="sprite1s" value="15" type="text"> pixels<br> Sprite1 colour:<input name="sprite1c" value="#000000" type="hex"> hex/rgb<br> <input name="update" onclick="updateStageInToFin()" value="Redraw Stage..." type="button"> (draw the stage) </form></html></p>Updated the one just above this text, the sprite can be any colour!
This is supposed to be what? And 1) your using html 4 which doesn't support canvas 2) we are using Jens's morphic.js for GE
0) It's a testing system/my snippet of code for it. It's a snippet: it doesn't need critism. It's just a test.
1) Maybe, but canvas works pretty fine.
2) Okay, but we should have another backup if morphic.js doesn't work for some person for any reason.
Okay. Ill put this on my dropbox. And by backup, you mean as a secondary application, right?
Offline
GP1 wrote:
Hey! Your code works great! What we really need is a way to do blocks!
Yep, we just need to fit in the blocks! And it's a pretty small page too, it's probably a good candidate for the final product.
Offline
rdococ wrote:
GP1 wrote:
Hey! Your code works great! What we really need is a way to do blocks!
Yep, we just need to fit in the blocks! And it's a pretty small page too, it's probably a good candidate for the final product.
Yeah. We were going to use jQuery, but jQuery doesn't support touch events. morphic.js does, but I can't figure out how to resize and reposition the panes
Offline
DigiTechs wrote:
GP1 wrote:
DigiTechs wrote:
so will there be a 3DS test-scratch program yet??test this and see if it works
if there was blocks, they didn't work, but everythingnelse did
Did you test it on a computer or 3ds?
Offline
Updated it again, with a simple try-catch since alot of it is pretty complicated.
Oops, wrong code. I wanted to copy something else. Let me do that again.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <h2>Go Everywhere Snippet</h2></head><body> <style type="text/css"> body { background-color:#f1f1f1; } h1 { color:black; text-align:center; } p { font-family:"Arial"; font-size:10px; } </style> <br> <form name="data"> <canvas id="stage" width="120" height="120" style="border: 0px solid rgb(0, 0, 0);">Cannot display project! Please switch to a browser with canvas support. </canvas><br> <script type="text/javascript"> function updateStageInToFin() { try { var c=document.getElementById("stage"); // Gain access to the stage. var cxt=c.getContext("2d"); // Finish the data in the C variable. cxt.fillStyle="#F1F1F1"; // Selects a fill style, ready for refreshing. cxt.fillRect(0,0,10000,10000); // Clears the stage, to refresh the positions. cxt.fillStyle=document.data.backc.value; // Sets the background colour. cxt.fillRect(0,0,120,120); // Creates the background. cxt.fillStyle=document.data.sprite1c.value; // This sets the sprite's colour. cxt.beginPath(); // This begins the arc. cxt.arc(document.data.sprite1x.value,document.data.sprite1y.value,document.data.sprite1s.value,15,Math.PI*2,true); // This draws the arc. cxt.closePath(); // This ends the arc. cxt.fill(); // This was just added. } catch(err) // Dare an error happen, this saves the day! { alert(err + ". Please report to the thread!") } } </script> <p> Background colour:<input name="backc" value="white" type="hex"> hex/rgb<br> Sprite1 X:<input name="sprite1x" value="15" type="text"> pixels<br> Sprite1 Y:<input name="sprite1y" value="15" type="text"> pixels<br> Sprite1 size:<input name="sprite1s" value="15" type="text"> pixels<br> Sprite1 colour:<input name="sprite1c" value="red" type="hex"> hex/rgb<br> <input name="update" onclick="updateStageInToFin()" value="Redraw Stage..." type="button"> (draw the stage) </form></html></p>
Last edited by rdococ (2012-02-04 03:48:34)
Offline
rdococ wrote:
GP1 wrote:
DigiTechs wrote:
if there was blocks, they didn't work, but everythingnelse didDid you test it on a computer or 3ds?
Can you put that on a different sitemaker? I can't access DropBox. Maybe put it on weebly?
I could on the 3DS, but there's a problem with the y size, cutting off most of the circle.
Offline
Hey, just asking, can comp500 host my code for me? I want to test it on my 3DS.
Updated my script on the way:
<!DOCTYPE html> <html> <head> <p><b>Go Everywhere Snippet</b></p></head><body> <style type="text/css"> body { background-color:#f1f1f1; } h1 { color:black; text-align:right; } p { font-family:"Verdana"; font-size:10px; } </style> <form name="data"><p> <canvas id="stage" width="120" height="120" onclick="updateStageInToFin()" style="border: 1px solid rgb(0, 0, 0);">Cannot display project! Please switch to a browser with canvas support. </canvas></p> <script type="text/javascript"> function updateStageInToFin() { try { var c=document.getElementById("stage"); // Gain access to the stage. var cxt=c.getContext("2d"); // Finish the data in the C variable. // Removed 2 commands from here cxt.fillStyle=document.data.backc.value; // Sets the background colour. cxt.fillRect(0,0,120,120); // Creates the background. cxt.fillStyle=document.data.sprite1c.value; // This sets the sprite's colour. cxt.beginPath(); // This begins the arc. cxt.arc(document.data.sprite1x.value,document.data.sprite1y.value,document.data.sprite1s.value,15,Math.PI*2,true); // This draws the arc. cxt.closePath(); // This ends the arc. cxt.fill(); // This was just added. } catch(err) // Dare an error happen, this saves the day! { alert(err + ". Please report to the thread!") } } </script><noscript>Fatal Error: JavaScript needed!</noscript> <p> Background colour:<input name="backc" onclick="updateStageInToFin()" value="white" type="color"> hex/rgb<br> Sprite1 X:<input name="sprite1x" onclick="updateStageInToFin()" value="60" type="text">/120 pixels<br> Sprite1 Y:<input name="sprite1y" onclick="updateStageInToFin()" value="60" type="text">/120 pixels<br> Sprite1 size:<input name="sprite1s" onclick="updateStageInToFin()" value="20" type="text">/120 pixels<br> Sprite1 colour:<input name="sprite1c" onclick="updateStageInToFin()" value="#FF8000" type="color"> hex/rgb<br> Click any textbox or canvas to update the stage. </form></html></p>
Offline
It's yet that I update it again.
Currently, there's no way to begin a script, but I'll do that in a minute.
<!DOCTYPE html> <html> <head> <p><b>Go Everywhere Snippet</b></p></head><body> <style type="text/css"> body { background-color:#f1f1f1; } h1 { color:black; text-align:right; } p { font-family:"Verdana"; font-size:10px; } </style> <form name="data"><p> <canvas id="stage" width="120" height="120" onclick="updateStageInToFin()" style="border: 1px solid rgb(0, 0, 0);">Cannot display project! Please switch to a browser with canvas support. </canvas></p> <script type="text/javascript"> function updateStageInToFin() { try { var c=document.getElementById("stage"); // Gain access to the stage. var cxt=c.getContext("2d"); // Finish the data in the C variable. // Removed 2 commands from here cxt.fillStyle=document.data.backc.value; // Sets the background colour. cxt.fillRect(0,0,120,120); // Creates the background. cxt.fillStyle=document.data.sprite1c.value; // This sets the sprite's colour. cxt.beginPath(); // This begins the arc. cxt.arc(document.data.sprite1x.value,document.data.sprite1y.value,document.data.sprite1s.value,15,Math.PI*2,true); // This draws the arc. cxt.closePath(); // This ends the arc. cxt.fill(); // This was just added. } catch(err) // Dare an error happen, this saves the day! { alert(err + ". Please report to the thread!") } } function getLine(text, line){ var lines = text.split("$"); return lines[line - 1]; } function runScript(i){ // Run scripts! var a=i; while (a<=5) { var vari= var executer=getLine(document.data.scripts.value,i); if (executer=="move+"){ document.data.sprite1x.value=++document.data.sprite1x.value; } if (executer="move-"){ document.data.sprite1x.value=--document.data.sprite1x.value; } if (executer="size+"){ document.data.sprite1s.value=++document.data.sprite1s.value; } if (executer="size-"){ document.data.sprite1s.value=--document.data.sprite1s.value; } if (executer="var+"){ document.data.variable.value=++document.data.variable.value; } if (executer="var-"){ document.data.variable.value=--document.data.variable.value; } if (executer="ifvarequals"){ var i=++i; var executer=getLine(document.data.scripts.value,i); var iseq=executer var i=++i; var executer=getLine(document.data.scripts.value,i); if (document.data.variable.value==iseq) { runScript(i) } } updateStageInToFin(); i++; } } </script><noscript>Fatal Error: JavaScript needed!</noscript> <p> Background colour:<input name="backc" onclick="updateStageInToFin()" value="white" type="color"> hex/rgb<br> Sprite1 X:<input name="sprite1x" onclick="updateStageInToFin()" value="60" type="text">/120 pixels<br> Sprite1 Y:<input name="sprite1y" onclick="updateStageInToFin()" value="60" type="text">/120 pixels<br> Sprite1 size:<input name="sprite1s" onclick="updateStageInToFin()" value="20" type="text">/120 pixels<br> Sprite1 colour:<input name="sprite1c" onclick="updateStageInToFin()" value="#FF8000" type="color"> hex/rgb<br> Sprite1 script: <input name="scripts" type="text" onclick="updateStageInToFin()" value="scripts here..." id="scripts"><br> Sprite1 variable:<input name="variable" type="text" onclock="updateStageInToFin()" value="0"><br> Seperate commands with a dollar ($) and see the script for commands. </form></html></p>
Offline
I need a green flag the size of the one in Scratch 1.4 for my "run" button!
Offline
I had to remove the script thingy since it wasn't working. Apparently I think I was setting a string to another string.
<!DOCTYPE html> <html> <head> <p><b>Go Everywhere Snippet</b></p></head><body> <style type="text/css"> body { background-color:#f1f1f1; } h1 { color:black; text-align:right; } p { font-family:"Verdana"; font-size:10px; } </style> <form name="data"><p> <canvas id="stage" width="120" height="120" onclick="updateStageInToFin()" style="border: 1px solid rgb(0, 0, 0);">Cannot display project! Please switch to a browser with canvas support. </canvas></p> <script type="text/javascript"> function updateStageInToFin() { var c=document.getElementById("stage"); // Gain access to the stage. var cxt=c.getContext("2d"); // Finish the data in the C variable. // Removed 2 commands from here cxt.fillStyle=document.data.backc.value; // Sets the background colour. cxt.fillRect(0,0,120,120); // Creates the background. cxt.fillStyle=document.data.sprite1c.value; // This sets the sprite's colour. cxt.beginPath(); // This begins the arc. cxt.arc(document.data.sprite1x.value,document.data.sprite1y.value,document.data.sprite1s.value,15,Math.PI*2,true); // This draws the arc. cxt.closePath(); // This ends the arc. cxt.fill(); // This was just added. } </script><noscript>Fatal Error: JavaScript needed!</noscript> <p> Background colour:<input name="backc" onclick="updateStageInToFin()" value="white" type="color"> hex/rgb<br> Sprite1 X:<input name="sprite1x" onclick="updateStageInToFin()" value="60" type="text">/120 pixels<br> Sprite1 Y:<input name="sprite1y" onclick="updateStageInToFin()" value="60" type="text">/120 pixels<br> Sprite1 size:<input name="sprite1s" onclick="updateStageInToFin()" value="20" type="text">/120 pixels<br> Sprite1 colour:<input name="sprite1c" onclick="updateStageInToFin()" value="#FF8000" type="color"> hex/rgb<br> Sprite1 variable:<input name="variable" type="text" onclock="updateStageInToFin()" value="0"><br> </form></html></p>
Offline
jslomba wrote:
whizzer wrote:
Anything new to test? I haven't checked for a while.
Yes, my little snippet has been updated.
Offline
@ rdococ - Here it is: http://goeverywhere.x11s.org/tests/rodococTest.html
Last edited by comp500 (2012-02-05 04:10:06)
Offline
comp500 wrote:
@ rdococ - Here it is: http://goeverywhere.x11s.org/tests/rodococTest.html
Thank you! Works awesome on my computer.
Offline
comp500 wrote:
@ rdococ - Here it is: http://goeverywhere.x11s.org/tests/rodococTest.html
Works well on an iOS device.
Offline