Skip to main content
infervour.com

Back to all posts

How to Keep Text on Image In Kineticjs?

Published on
3 min read
How to Keep Text on Image In Kineticjs? image

Best Graphic Design Software Solutions to Buy in October 2025

1 Graphics Drawing Tablet, UGEE M708 10 x 6 inch Large Drawing Tablet with 8 Hot Keys, Passive Stylus of 8192 Levels Pressure, UGEE M708 Graphics Tablet for Paint, Design, Art Creation Sketch Black

Graphics Drawing Tablet, UGEE M708 10 x 6 inch Large Drawing Tablet with 8 Hot Keys, Passive Stylus of 8192 Levels Pressure, UGEE M708 Graphics Tablet for Paint, Design, Art Creation Sketch Black

  • SPACIOUS DRAWING AREA: 10 X 6 INCH SURFACE ENHANCES YOUR CREATIVITY.
  • PRECISION CONTROL: 8192 LEVELS OF PRESSURE FOR DETAILED, VARIED ARTWORK.
  • UNIVERSAL COMPATIBILITY: WORKS SEAMLESSLY WITH MAJOR OS AND CREATIVE SOFTWARE.
BUY & SAVE
$39.99 $46.99
Save 15%
Graphics Drawing Tablet, UGEE M708 10 x 6 inch Large Drawing Tablet with 8 Hot Keys, Passive Stylus of 8192 Levels Pressure, UGEE M708 Graphics Tablet for Paint, Design, Art Creation Sketch Black
2 Logitech MX Creative Console, 9 Customizable LCD Keys, Stream Deck Accessories, Control Dial for Graphic Design, Adobe, Zoom, Spotify - Graphite, 3-Month Adobe Creative Cloud Membership

Logitech MX Creative Console, 9 Customizable LCD Keys, Stream Deck Accessories, Control Dial for Graphic Design, Adobe, Zoom, Spotify - Graphite, 3-Month Adobe Creative Cloud Membership

  • BOOST YOUR PRODUCTIVITY WITH QUICK ACCESS TO ESSENTIAL APPS.

  • FULLY CUSTOMIZE 15 KEYPAD PAGES WITH PERSONALIZED ICONS AND ACTIONS.

  • GET 3 MONTHS OF ADOBE CREATIVE CLOUD FREE WITH YOUR PURCHASE!

BUY & SAVE
$169.99 $199.99
Save 15%
Logitech MX Creative Console, 9 Customizable LCD Keys, Stream Deck Accessories, Control Dial for Graphic Design, Adobe, Zoom, Spotify - Graphite, 3-Month Adobe Creative Cloud Membership
3 Mr. Pen Geometry Set with 6 Inch Swing Arm Protractor, Divider, Set Squares, Ruler, Compasses and Protractor, 15 Piece Set, Back to School Supplies

Mr. Pen Geometry Set with 6 Inch Swing Arm Protractor, Divider, Set Squares, Ruler, Compasses and Protractor, 15 Piece Set, Back to School Supplies

  • COMPLETE 15-PIECE SET FOR ALL GEOMETRY NEEDS, IDEAL FOR ALL LEVELS.
  • DURABLE, PORTABLE POUCH: EASY TO CARRY AND STORE ON-THE-GO.
  • EXPERT-DESIGNED FOR PRECISION TEACHING AND LEARNING IN GEOMETRY.
BUY & SAVE
$11.99
Mr. Pen Geometry Set with 6 Inch Swing Arm Protractor, Divider, Set Squares, Ruler, Compasses and Protractor, 15 Piece Set, Back to School Supplies
4 Graphic Design For Everyone: Understand the Building Blocks so You can Do It Yourself

Graphic Design For Everyone: Understand the Building Blocks so You can Do It Yourself

BUY & SAVE
$18.00 $27.00
Save 33%
Graphic Design For Everyone: Understand the Building Blocks so You can Do It Yourself
5 Wacom Intuos Small Bluetooth Graphics Drawing Tablet, Portable for Teachers, Students and Creators, 4 Customizable ExpressKeys, Compatible with Chromebook Mac OS Android and Windows - Pistachio

Wacom Intuos Small Bluetooth Graphics Drawing Tablet, Portable for Teachers, Students and Creators, 4 Customizable ExpressKeys, Compatible with Chromebook Mac OS Android and Windows - Pistachio

  • BATTERY-FREE PRECISION: ENJOY UNPARALLELED CONTROL LIKE PEN ON PAPER.

  • UNIVERSAL SOFTWARE COMPATIBILITY: CREATE FREELY WITH ANY GRAPHICS PROGRAM.

  • WIRELESS FLEXIBILITY: WORK ANYWHERE WITH BLUETOOTH OR USB CONNECTIVITY.

BUY & SAVE
$39.95 $59.95
Save 33%
Wacom Intuos Small Bluetooth Graphics Drawing Tablet, Portable for Teachers, Students and Creators, 4 Customizable ExpressKeys, Compatible with Chromebook Mac OS Android and Windows - Pistachio
6 Muchcute Micro Fineliner Drawing Art Pens: 12 Black Fine Line Waterproof Ink Set Artist Supplies Archival Inking Markers Liner Sketch Outline Anime Gifts Manga Sketching Watercolor Zentangle Kit Stuff

Muchcute Micro Fineliner Drawing Art Pens: 12 Black Fine Line Waterproof Ink Set Artist Supplies Archival Inking Markers Liner Sketch Outline Anime Gifts Manga Sketching Watercolor Zentangle Kit Stuff

  • VERSATILE PEN TIPS: 12 TIPS FROM 0.2MM TO 3.0MM, PERFECT FOR ALL STYLES.

  • NO SMUDGE, WATERPROOF INK: ENSURE YOUR ART STAYS VIBRANT AND INTACT.

  • IDEAL GIFT PACKAGING: COMES IN A STYLISH CASE, PERFECT FOR ANY OCCASION.

BUY & SAVE
$9.99 $11.99
Save 17%
Muchcute Micro Fineliner Drawing Art Pens: 12 Black Fine Line Waterproof Ink Set Artist Supplies Archival Inking Markers Liner Sketch Outline Anime Gifts Manga Sketching Watercolor Zentangle Kit Stuff
7 XPPen Drawing Tablet with Screen Full-Laminated Graphics Drawing Monitor Artist13.3 Pro Graphics Tablet with Adjustable Stand and 8 Shortcut Keys (8192 Levels Pen Pressure, 123% sRGB)

XPPen Drawing Tablet with Screen Full-Laminated Graphics Drawing Monitor Artist13.3 Pro Graphics Tablet with Adjustable Stand and 8 Shortcut Keys (8192 Levels Pen Pressure, 123% sRGB)

  • EFFORTLESS SHADING WITH 60° TILT FUNCTION FOR SMOOTH CREATIVITY.

  • RICH COLORS & VIVID IMAGES ON 13.3” FULLY-LAMINATED DISPLAY.

  • CUSTOMIZABLE CONTROLS & WORKFLOW TO ENHANCE YOUR ARTISTIC PROCESS.

BUY & SAVE
$209.99 $259.99
Save 19%
XPPen Drawing Tablet with Screen Full-Laminated Graphics Drawing Monitor Artist13.3 Pro Graphics Tablet with Adjustable Stand and 8 Shortcut Keys (8192 Levels Pen Pressure, 123% sRGB)
8 FULINJOY 5PCS Dotting Pens with 3 PCS Nail Painting Brushes, Nail Art Design Tools

FULINJOY 5PCS Dotting Pens with 3 PCS Nail Painting Brushes, Nail Art Design Tools

  • CREATE UNIQUE NAIL ART STYLES WITH 8 PROFESSIONAL TOOLS!
  • VERSATILE DOTTING PENS AND BRUSHES FOR DETAILED DESIGNS.
  • DURABLE, VIBRANT TOOLS THAT MAKE NAIL ART EFFORTLESS AND FUN!
BUY & SAVE
$3.99
FULINJOY 5PCS Dotting Pens with 3 PCS Nail Painting Brushes, Nail Art Design Tools
9 HUION Inspiroy H640P Drawing Tablet, 6x4 inch Digital Art with Battery-Free Stylus, 8192 Pen Pressure, 6 Hot Keys, Graphics Tablet for Drawing, Writing, Design, Teaching, Work with Mac, PC & Mobile

HUION Inspiroy H640P Drawing Tablet, 6x4 inch Digital Art with Battery-Free Stylus, 8192 Pen Pressure, 6 Hot Keys, Graphics Tablet for Drawing, Writing, Design, Teaching, Work with Mac, PC & Mobile

  • CUSTOMIZE FOR EFFICIENCY: SIX CUSTOMIZABLE KEYS FOR SMOOTHER WORKFLOW.

  • NATURAL DRAWING FEEL: BATTERY-FREE PEN WITH 8192 PRESSURE LEVELS FOR ACCURACY.

  • PORTABLE DESIGN: ULTRA-SLIM AND LIGHTWEIGHT FOR CREATIVITY ON-THE-GO.

BUY & SAVE
$37.99 $39.99
Save 5%
HUION Inspiroy H640P Drawing Tablet, 6x4 inch Digital Art with Battery-Free Stylus, 8192 Pen Pressure, 6 Hot Keys, Graphics Tablet for Drawing, Writing, Design, Teaching, Work with Mac, PC & Mobile
+
ONE MORE?

You can keep text on an image in KineticJS by using the Text object and adding it to the same layer as the image in your KineticJS stage. By positioning the text element relative to the image's x and y coordinates, you can ensure that the text remains on top of the image as it moves or is interacted with in your KineticJS application.

How to align text on an image in kineticjs?

To align text on an image in KineticJS, you can use the align() method provided by the KineticJS library.

Here is an example code snippet to align text to the center of an image in KineticJS:

//create a stage var stage = new Kinetic.Stage({ container: 'container', width: 500, height: 500 });

//create a layer var layer = new Kinetic.Layer();

//create an image var imageObj = new Image(); imageObj.onload = function() { var image = new Kinetic.Image({ x: 100, y: 100, image: imageObj, width: 200, height: 200 });

//create text var text = new Kinetic.Text({ x: 100, y: 100, text: 'Hello, World!', fontSize: 20, fontFamily: 'Arial', fill: 'black', align: 'center' //align text to center of image });

//add image and text to layer layer.add(image); layer.add(text);

//add layer to stage stage.add(layer); };

imageObj.src = 'path_to_image.jpg';

In the code above, we first create a Kinetic.Stage and a Kinetic.Layer. We then create an image and a text object. We use the align property of the text object to align the text to the center of the image. Finally, we add the image and text to the layer and add the layer to the stage.

What is the text attribute in kineticjs?

The text attribute in KineticJS is a property that allows you to set and customize the text content displayed in a text shape or node within a KineticJS canvas. This attribute can be used to define the text content, font family, font size, font style, text color, and alignment of the text within the shape or node. It allows you to create custom text elements and labels within your KineticJS application.

How to move text on an image in kineticjs?

To move text on an image in KineticJS, you can follow these steps:

  1. Create a new KineticJS stage and layer:

var stage = new Kinetic.Stage({ container: 'container', width: 800, height: 600 });

var layer = new Kinetic.Layer(); stage.add(layer);

  1. Add an image to the layer:

var imageObj = new Image(); imageObj.onload = function() { var image = new Kinetic.Image({ x: 0, y: 0, image: imageObj, width: 800, height: 600 }); layer.add(image); layer.draw(); }; imageObj.src = 'image.jpg';

  1. Add text to the layer and define its initial position:

var text = new Kinetic.Text({ x: 100, y: 100, text: 'Hello', fontSize: 30, fontFamily: 'Calibri', fill: 'black' }); layer.add(text); layer.draw();

  1. Use KineticJS animations to move the text across the image:

var anim = new Kinetic.Animation(function(frame) { var newX = text.getX() + Math.sin(frame.time * 2 * Math.PI / 200) * 2; var newY = text.getY() + Math.cos(frame.time * 2 * Math.PI / 200) * 2; text.setX(newX); text.setY(newY); }, layer); anim.start();

By following these steps, you can create an interactive KineticJS animation where a text element moves across an image on the stage.