I just needed some help on how I can integrate the strokeWeight function of this code into the populateOptions, I am struggling quite a lot. some direction or help will be appreciated:
function FreehandTool(){
//set an icon and a name for the object
this.icon = "assets/freehand.jpg";
this.name = "freehand";
this.line = line
var previousMouseX = -1;
var previousMouseY = -1;
var optionPlacing = select("#strokeControl");
var self = this;
//controls the function for stroke weight
var lineWeight = createInput("");
lineWeight.parent(optionPlacing);
lineWeight.input(function(){
self.line = this.value();
});
this.draw = function(){
strokeWeight(this.line);
//will save the last pixels
updatePixels();
//if the mouse is pressed
if(mouseIsPressed){
//check if they previousX and Y are -1. set them to the current
//mouse X and Y if they are.
if (previousMouseX == -1){
previousMouseX = mouseX;
previousMouseY = mouseY;
}
//if we already have values for previousX and Y we can draw a line from
//there to the current mouse location
else{
line(previousMouseX, previousMouseY, mouseX, mouseY);
previousMouseX = mouseX;
previousMouseY = mouseY;
}
}
else{
previousMouseX = -1;
previousMouseY = -1;
}
//will save the current drawing
loadPixels();
};
this.unselectTool = function() {
updatePixels();
//clear options
select(".options").html("");
};
this.populateOptions = function() {
select(".options").html();
};
}
so as you can see, I'm trying to figure out a way to integrate the stroke weight bit in the HTML brackets of the code but its not working