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

Easily convert between Fabric JS IText and Textbox?
fabricjs on retina: new object jumps to left top
Fabric.js rectangle is not showing up
How to fetch all properties of an object in fabricjs?
How to check fabricjs text is multi line?
Get foci of fabric.Ellipse
Snap fabric.Line to 45 degree angle
Convert back fabric.Group.toJSON() to fabric.Group
FabricJS - What is Building?
Cannot install Fabric.js in mac OS X EI Capitan
How to get the background image of canvas after loading with loadFromJSON fabricjs?
Fabricjs i-text clone issue
Pattern not applying on line object fabricjs
Rotate and scale within fabricjs bounding box
How to get individual object's width, height, left and top in selection:created event?
Multiple fabric curved text onjects in a single canvas

Categories

HOME
eclipse
localization
design-patterns
depth
zend-framework
solver
replace
seo
cublas
rom
angularfire2
nfs
teechart
owin
rtf
php-5.6
libc
libusb
gruntfile
standards
symfony-console
shortest-path
lilypond
drive
spring-async
backpack-for-laravel
windows-server-2003
android-sharedpreferences
jasmine-node
quantlib
dotspatial
postback
cart
quickfixj
jett
android-gridview
contacts
graphhopper
cd
z-notation
trigonometry
plr
logback-groovy
outputcache
importerror
pom.xml
lampp
spring-data-couchbase
android-testing
headless
ngmaterial
mach-o
django-1.10
sandcastle
visual-studio-2008-sp1
mapxtreme
google-cloud-console
watch-os-2
nikeplus-api
hclust
dimension
jclouds
embedding
google-query-language
nservicebus5
cassia
data-protection
phpwebsocket
database-relations
cycle2
phpgrid
toran-proxy
gocql
intel-c++
fuelcms
sql-server-data-tools
omnifaces
typeconverter
diff3
broadband
rmysql
jqmodal
angular-carousel
jjaql
sbcl
ie8-compatibility-mode
cmmi
traceability
twisted.web
sentestingkit
mapping-by-code
httponly
ilasm
cgimage
box2d-iphone
relative
winmain
codebase
cruisecontrol.rb
application-verifier
sifr
qtabbar
web-application-project
ifilter

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