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

fabricjs - moving group by selection only one of the item
Importing SVG in Fabric.js is not working correctly
how to resize only object but not pattern
Make text grow uni-directionally on calling set('text', 'some value')
fabric.js make active object on top of others when dragging
How to update size of group in fabricjs
Circle mousedown not working after moving
Any way to stretch/collapse canvas grid in fabric js?
Triggering mousedown/touch and drag and release events in Fabric.js remotely
How to increase the selection area of a fabric Object?
Is it possible to animate filter in Fabric.js?
How to change the image of the fabric.Image object attribute src?
As you can only change the portion of a loaded image?
What is the origin of an image added to a canvas in FabricJS?
Fabricjs Text object fontSize units
fabricjs object / canvas fire an event manually

Categories

HOME
google-app-engine
search
assembly
oracle12c
porting
scikit-learn
gdb
eslint
css3
ns-3
swt
apache-spark-mllib
jwplayer
opendj
babeljs
bookmarks
iis-6
categorical-data
resultset
supervisor
speech-synthesis
plink
flash-player
entitymanager
xmonad
babel
appirater
bioinformatics
alm
cognos-bi
hibernate-validator
fstream
catch-unit-test
erb
login-script
dynamic-jasper
git-rewrite-history
jpad
timing
nohup
verifiable-c
kill
magento-1.9.3
drupal-theming
uiimage
wcftestclient
dbcontext
datamaps
context-switch
spring-data-couchbase
type-theory
tinkerpop3
macaulay2
drawstring
bizagi
sapi
decimalformat
pypiserver
django-urls
fail2ban
android-broadcast
shopizer
qtwebengine
cryptographichashfunction
mass-assignment
ejb-2.x
nodelist
sip-server
nsmenu
decoupling
amslidemenu
scrypt
away3d
asdf
ui-select2
facebook-timeline
wp7test
virtual-pc
robotlegs
rmiregistry
window-decoration
fitbounds
virtualpathprovider
apache-commons-dbutils
diagrams
zen
blender-2.49
build-environment
strtod
web-application-project
cldc
asynchronous-wcf-call
linfu-dynamicproxy
entitykey
mathematical-typesetting

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