Interactive text fields with Fabric.js

前端 未结 6 720
梦如初夏
梦如初夏 2021-01-30 17:49

I\'ve been playing with Fabric.js a lot in the last few weeks, but regarding text fields I\'ve only found it possible to set the text on creation.

Is there any possible

6条回答
  •  独厮守ぢ
    2021-01-30 18:26

    assuming you have both the canvas and the context as variables in your script:

    // write text
    context.fillText("text1",0,0);
    
    
    // refresh canvas and write new text
    context.clearRect(0,0,canvas.width,canvas.height);
    context.fillText("text2",0,0);
    

提交回复
热议问题