Interactive text fields with Fabric.js

前端 未结 6 674
梦如初夏
梦如初夏 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:20

    Try this(this is from my application):

    Text Color: 
    
    
    textColor.onchange = function() {
                canvas.getActiveObject().setColor(this.value);
                canvas.renderAll();
            };
    
    function updateControls() {         
                textControl.value = canvas.getActiveObject().getText();
            }
    
            canvas.on({
                'object:selected': updateControls,
            });
    

提交回复
热议问题