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

Fabric JS how to address a SVG
character width calculation wrong with some font which can make auto indent
fabricjs - Image zoom and cropArea
use svg as a pattern background in NODE is not working
How to get the edited text from itext in fabricjs
How do I get the shadow color value of some text in Fabric JS?
Move and rotate line by one point
How can I let the user resize an element non-proportionally with a corner control?
Fabric.js: Create placeholders for images on canvas & export canvas as image?
How do i make all the shapes selected, i mean shapes must always be activated so that i do not need to click any shape
What is the expected gesture/tap event to edit FabricJs IText on mobile?
fabricJS Not persisting Floodfill
How to trigger the moving event for objects with their lockMovement properties set to false?
FabricJS: How to rotate a single path object in path-group?
Export FabricJS canvas to PNG/JPG with Images in it
Fabric.js: How to serialize clipTo objects since ToJSON does not work for it?

Categories

HOME
c99
css3
jax-rs
angular2-material
static
ms-access-2016
mql5
siddhi
pybossa
shared-libraries
enterprise-architect
plink
glyphicons
mvc-mini-profiler
feathersjs
android-7.0-nougat
digital-signature
identity-management
nodemcu
sencha-touch
imagemap
dpdk
backpack-for-laravel
react-toolbox
angular-routing
aggregation
windows-server-2003
siri
android-sharedpreferences
linked-data
openmdao
failover
wacom
least-squares
loading
portforwarding
signal-strength
linter
twilio-click-to-call
static-cast
boo
type-theory
mach-o
mouseleave
materialized-path-pattern
visual-studio-2008-sp1
resourcemanager
neon
nikeplus-api
respondcms
nullable
crouton-os
spring-retry
state-restoration
grgit
coda
cross-join
sip-server
reflector
live555
malformedurlexception
mutual-authentication
paste
android-framework
vsx
getopt
visual-studio-express
notorm
mbunit
ice-cube
midlet
zope.interface
multiplexing
oracle-enterprise-linux
isa-swizzling
node-redis
qglwidget
opml
java1.4
blind

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