Can't save the project


Hey, @MisterMender @Luxapodular
Sorry to bother u, I have a question, I want to make a random triangle, and I find the code for Javascript in HTML

window.onload = function(){

var previewButton = document.getElementById("previewButton");
previewButton.onclick = previewButtonHandler;


//setInterval(previewButtonHandler, 500);


function previewButtonHandler()
var canvas = document.getElementById(“canvasView”);

var context = canvas.getContext("2d");

clearCanvas(canvas, context);

drawTriangle(canvas, context);


function drawTriangle(canvas, context)
context.moveTo(getRandom(canvas.width), getRandom(canvas.height));
context.lineTo(getRandom(canvas.width), getRandom(canvas.height));
context.lineTo(getRandom(canvas.width), getRandom(canvas.height));

context.lineWidth = 1; 
context.fillStyle = getRandomColor(); 


function getRandom(bound)
return Math.floor(Math.random() * bound);

function clearCanvas(canvas, context)
context.fillStyle = “white”; context.fillRect(0, 0, canvas.width, canvas.height); }

and my question is in wick editor, Is there a parameter like 2d that can call the brush function, or maybe there are other ways to implement this function


Hey @andy,

Unfortunately, the Wick Editor doesn’t have a way to draw with code quite yet. We’ll be looking into this in Wick Editor 1.0, but aren’t sure what the best way to add it in is quite yet.


Oh, that 's ok, just asking, I can find another way to develop my project, thank you for your reply~
have a nice day!