Found 538 Articles for HTML5 Canvas

How to set the position of Textbox from left using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 14:06:58

185 Views

In this tutorial, we are going to learn how to set the position of a Textbox from the left using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The position from left can be changed by using the left property. Syntax new fabric.Textbox(text: String, { left: Number }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our textbox. ... Read More

How to set the padding of Textbox using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 14:02:29

487 Views

In this tutorial, we are going to learn how to set the padding of a Textbox using FabricJS. Textbox is one of the various shapes provided by FabricJS. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also set the padding of a textbox object. This can be done by using the padding property. Syntax new fabric.Textbox(text: String, { padding : Number }: Object) Parameters ... Read More

How to set the opacity of Textbox using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 13:57:43

191 Views

In this tutorial, we are going to learn how to set the opacity of Textbox using FabricJS. Textbox is one of the various shapes provided by FabricJS. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. We can customize a textbox object by adding a fill colour to it, eliminate its borders or even make changes in its dimensions. Similarly, we can also change its opacity by using the opacity property. Syntax new fabric.Textbox(text: String, { opacity: Number }: Object) Parameters text − This parameter ... Read More

How to set the minimum allowed scale value of Textbox using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 13:52:51

244 Views

In this tutorial, we are going to learn how to set the minimum allowed scale of Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Similarly, we can also set its minimum allowed scale by using the minScaleLimit property. Syntax new fabric.Textbox(text: String, { minScaleLimit : Number }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our ... Read More

How to set the horizontal scale factor of Textbox using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 13:49:22

176 Views

In this tutorial, we are going to learn how to set the horizontal scale factor of a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also set the horizontal scale factor of a textbox object. This can be done by using the scaleX property. Syntax new fabric.Textbox(text: String, { scaleX ... Read More

How to set the fill colour of text in Textbox using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 13:42:46

1K+ Views

In this tutorial, we are going to learn how we can change the appearance of a Textbox object by changing the fill colour of its text using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. We can change the fill colour by using the fill property which allows us to specify the colour of the text in the Textbox. Syntax new fabric.Textbox(text: String, { fill: String }: Object) Parameters text ... Read More

How to set the edit mode of Textbox using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 13:37:39

2K+ Views

In this tutorial, we are going to learn how to enable the edit mode of a Textbox using FabricJS. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also edit the text in our Textbox. This can be enabled or disabled by using the editable property. Syntax new fabric.Textbox(text: String, { editable : Boolean }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our textbox. options (optional) − This parameter is an Object which provides ... Read More

How to set the dash pattern of controlling corners of Textbox using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 13:34:08

88 Views

In this tutorial, we are going to learn how we can implement the dash pattern of controlling corners of Textbox using FabricJS. The controlling corners of an object allow us to scale, stretch or change its position. We can customize our controlling corners in many ways such as adding a specific colour to it, changing its size, etc. We can also specify a dash pattern for the controlling corners by using the cornerDashArray property. Syntax new fabric.Textbox(text: String, { cornerDashArray: Array }: Object) Parameters text − This parameter accepts a String which is the text string that we ... Read More

How to set the colour of controlling corners of Textbox using FabricJS?

Rahul Gurung
Updated on 02-Aug-2022 13:30:55

109 Views

In this tutorial, we are going to set the colour of the controlling corners of Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. We can also customize the text itself by using properties like fontSize, fontFamily, fontStyle, fontWeight etc. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The cornerColor property allows us to manipulate the colour of the controlling corners when the object is active. Syntax new fabric.Textbox(text: String, { cornerColor: String }: Object) Parameters text ... Read More

How to set the border scale factor of Textbox using FabricJS?

Rahul Gurung
Updated on 03-Aug-2022 07:33:25

249 Views

In this article, we are going to set the border scale factor of Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. We can use the borderScaleFactor property which specifies the scale factor of the object's controlling borders. Syntax new fabric.Textbox(text: String, { borderOpacityWhenMoving: Number }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our textbox. options ... Read More

Advertisements