Found 566 Articles for FabricJS

How to make a Triangle invisible using FabricJS?

Rahul Gurung
Updated on 27-Jun-2022 11:37:21

94 Views

In this tutorial, we are going to learn how to make a Triangle invisible using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas.Our triangle object can be customized in various ways like changing its dimensions, adding a background color or by making it visible or invisible. We can do this by using the visible property.Syntaxnew fabric.Triangle( { visible: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our Triangle. Using ... Read More

How to make a Rectangle invisible using FabricJS?

Rahul Gurung
Updated on 27-Jun-2022 13:00:29

179 Views

In this tutorial, we are going to learn how to make a Rectangle invisible using FabricJS. Rectangle is one of the various shapes provided by FabricJS. In order to create a rectangle, we will have to create an instance of fabric.Rect class and add it to the canvas.Our rectangle object can be customized in various ways like changing its dimensions, adding a background color or by making it visible or invisible. We can do this by using the visible property.Syntaxnew fabric.Rect( { visible: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. ... Read More

How to maintain stroke width of a Triangle while scaling using FabricJS?

Rahul Gurung
Updated on 27-Jun-2022 09:26:01

107 Views

In this tutorial, we are going to learn how we can maintain the stroke width of Triangle while scaling using FabricJS. By default, the stroke width increases or decreases with respect to the object's scale values. However, we can disable this behaviour by using the strokeUniform property.Syntaxnew fabric.Triangle({ strokeUniform: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our triangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to the object of which strokeUniform is a property.Options KeysstrokeUniform − This property accepts a ... Read More

How to lock the vertical skewing of a Triangle using FabricJS?

Rahul Gurung
Updated on 27-Jun-2022 08:34:15

85 Views

In this tutorial, we are going to learn how to lock the vertical skewing of a Triangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a triangle object in the canvas, we can also specify whether we want to stop skewing an object vertically. This can be done by using the lockSkewingY property.Syntaxnew fabric.Triangle({ lockSkewingY : Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our triangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to the ... Read More

How to maintain stroke width of a Rectangle while scaling using FabricJS?

Rahul Gurung
Updated on 27-Jun-2022 12:53:45

147 Views

In this tutorial, we are going to learn how we can maintain the stroke width of Rectangle while scaling using FabricJS. By default, the stroke width increases or decreases with respect to the object's scale values. However, we can disable this behaviour by using the strokeUniform property.Syntaxnew fabric.Rect({ strokeUniform: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to the object of which strokeUniform is a property.Options keysstrokeUniform − This property accepts ... Read More

How to lock the vertical scaling of Triangle using FabricJS?

Rahul Gurung
Updated on 27-Jun-2022 07:54:29

91 Views

In this tutorial, we are going to learn how to lock the vertical scaling of a Triangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a triangle object in the canvas, we can also specify whether we want to stop scaling an object vertically. This can be done by using the lockScalingY property.Syntaxnew fabric.Triangle({ lockScalingY : Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our triangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to the ... Read More

How to lock the vertical skewing of Rectangle using FabricJS?

Rahul Gurung
Updated on 27-Jun-2022 07:33:10

83 Views

In this tutorial, we are going to learn how to lock the vertical skewing of a Rectangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also specify whether we want to stop skewing an object vertically. This can be done by using the lockSkewingY property.Syntaxnew fabric.Rect({ lockSkewingY : Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to ... Read More

How to lock the vertical scaling of Rectangle using FabricJS?

Rahul Gurung
Updated on 28-Jun-2022 09:16:25

91 Views

In this tutorial, we are going to learn how to lock the vertical scaling of a Rectangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also specify whether we want to stop scaling an object vertically. This can be done by using the lockScalingY property.Syntaxnew fabric.Rect({ lockScalingY : Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width and a lot of other properties can be changed related to ... Read More

How to lock the vertical movement of Triangle using FabricJS?

Rahul Gurung
Updated on 27-Jun-2022 06:46:32

63 Views

In this tutorial, we are going to learn how to lock the vertical movement of a Triangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a triangle object in the canvas, we can also specify whether we want it to move only in the X-axis. This can be done by using the lockMovementY property.Syntaxnew fabric.Triangle({ lockMovementY: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our triangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to the ... Read More

How to lock the rotation of a Triangle using FabricJS?

Rahul Gurung
Updated on 24-Jun-2022 14:35:55

77 Views

In this tutorial, we are going to learn how to lock the rotation of a Triangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a triangle object in the canvas, we can also specify whether we want it to rotate or not. This can be done by using the lockRotation property.Syntaxnew fabric.Triangle({ lockRotation : Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our triangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to the object of ... Read More

Advertisements