What would be some valid code for outputting the value of a text input to a jCanvas? For example:
Name [John Doe]
John Doe would then be outputted onto a jCanvas.
I think I have an idea about what would work, but I am not sure how to make it into valid jQuery code. Pseudocode below:
var input = #input.val
canvas.drawText(
input
(dimensions go here)
)
The code below achieves the output that you're looking for.
In summary we:
keyupevent on the#nameinputinputStringvariable whenever this occursclearCanvasmethod of jCanvas to remove any existing text on the canvasdrawTextmethod of jCanvas to print the text to the canvas