fabricjs


Adding text over images in fabricjs


developing this app in which there several images on a canvas and i am using using fabricjs.
i want to add text overlaid on an image and then be able to remove it as well.
is a way to directly write over the image or do i have to create another layer and write onto it.
there is text related like
var text = new fabric.Text('hello world', { left: 100, top: 100 });
canvas.add(text);
the problem with the above approach is that if the image moves the text will not, so is it possible that the text could be written directly above the image?
any ideas of how this could be done? i revived several discussions where it's not as clear, how it could be done.
any pointers would be most appreciated.
I am not quite clear of what exactly is your requirement.
Regardless of it, i have created a jsfiddle for you. Please visit this.
https://jsfiddle.net/xpntggdo/9/
textBox=new fabric.Textbox("Enter Text",{
fontSize: 16,
fontFamily: 'Arial',
textAlign: 'left',
width: 180, // for 20 characters
top:arrowTop,
left:arrowLeft
});
canvas.add(textBox);
canvas.renderAll();
This might be of a little help at least. Comment on this answer and I will try to help you more on it if that is possible for me. Please upvote if you like it.

Related Links

Dragging in Fabric.js
Using glfx.js filters in Fabric.js
Fabric.js loadFromJSON width/height properties deserialization
Fabric.js - text decoration looks not exactly right
Fabric.js flipX and flipY don't seem to work
originX and originY are not set to center by default in 1.3.9 [closed]
How to get polygon points in Fabric.js
Creating and selecting a group programmatically with Fabric.js
Load from JSON is not working with Patterns in the latest version of Fabric.js
Load from JSON in Fabric.js loading default properties
How to `lockscaleX` and `lockscaleY` but allow `uniscaling` the object in Fabric.js?
canvas.toDataURL to Wordpress Library
Set object drag limit in Fabric.js
How to know the degree of rotation of the Fabric.js object?
Image does not load when using canvas.loadFromJSON in Fabric.js 1.3.0
What is the appropriate way to clear eventlisteners from fabricjs canvas?

Categories

HOME
grok
fabricjs
cublas
permissions
mips
data-visualization
mvc5
banner
recordrtc
bing-maps
fabric.io
g++
owin
siddhi
windows-ce
favicon
scrolltop
azure-iot-hub
aws-sdk
git-extensions
google-maps-autocomplete
poedit
flask-sqlalchemy
highstock
dapper-extensions
opentk
ms-access-2003
anki
dst
utorrent
r-grid
hard-drive
installshield-le
xajax
timing
nohup
node-mssql
ods
linq-to-objects
bindingnavigator
show-hide
xbmc
proget
vugen
tinymce-3
git-flow
otp
reshape
mouseleave
rxtx
rmongo
envi
swizzling
nservicebus5
angular-ui-typeahead
redis-cluster
crouton-os
state-restoration
tfs-workitem
fiware-monitoring
ess
viola-jones
ms-access-2000
actionfilterattribute
nodelist
boost-program-options
sonarqube-5.0
raygun
insight.database
xml-dsig
gwt-openlayers
light
solace-mq
breakout
observium
cnf
asdf
octal
stacky
android-sdk-2.3
sqlclr
jquery-blockui
zope.interface
iboutlet
listitem
correlated-subquery
apache-whirr
jsr286
wiimote
multiplatform
svk
photolibrary
cac
silent
non-clustered-index
sifr
wspbuilder

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App