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

How to implement exposure image filter using fabricjs basefilter?
Position of scaling points
Loading SVG to a canvas doesn't work
FabricJS Scale/Zoom Canvas to fit container
How to ignore fabric handlers while downloading canvas as image
Fabric.js colors are changing to black in subclassed fabric.Group
Is there any way to by skip Objects in sendToBack operation?
Setting Object align on Canvas
FabricJS - How to set transparent background for the Polyline and her Min/Max value range?
Setting textAlign on a per line basis of a text/iText/textbox object
set Min and Max resize limits for fabric object
Fabricjs move object to layer
FabricJS line - what is the correct way of combining left/right/x/y properties?
Fabric JS how to address a SVG
character width calculation wrong with some font which can make auto indent
fabricjs - Image zoom and cropArea

Categories

HOME
search
gridview
api
hyperlink
rdbms
nuget
switch-statement
emscripten
web-hosting
python-multithreading
azure-container-service
retrofit2
opengl-3
lanczos
sendgrid-api-v3
spin
g++
text-mining
watson-conversation
mongodb-csharp
symfony-2.8
microsoft-dynamics-nav
mathprog
android-7.0-nougat
xmonad
swagger-2.0
drive
articulate-storyline
spring-async
question2answer
tosca
direct3d11
game-theory
opentk
fable-f#
linked-data
intersystems-cache
rpgle
gp
sqsh
testcomplete
userdefaults
anki
postback
powershell-ise
pop3
nested-lists
least-squares
xajax
swagger-php
salesforce-communities
ideascript
release
loading
sharp-snmp
subclipse
print-css
ntvs
gitlist
stdmap
wpas
filehandle
mathcad
vibrate
testrail
materialized-path-pattern
cudd
simplepie
stax
webjars
qtplugin
burrows-wheeler-transform
deep
aurora
boost-serialization
piracy-prevention
phpgrid
sapi
java-money
xenomai
microsoft-reporting
skspritenode
telepat
apache-spark-1.3
webmatrix-3
beatsmusic
formview
insight.database
template-deduction
live555
xml-dsig
windows-embedded-standard
gwt-openlayers
spring-3
eclipse-kepler
code-duplication
ui-select2
facebook-timeline
swfobject
mkv
monotouch.dialog
boost-msm
wcf-configuration
stress
agility.js
procedures
qglwidget
vs-android
easyb
addchild
pagemethods
wcf-instancing
ifilter
httpcookie
commercial-application

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