Display text on image

how can I write text on Image or shape ,and become(the image and the text) one unit,so when i drag the image,also the text within it is dragged.

1 Like

Just display the image make a small offset with translate() and display the text()

When you use another translate before image() both will be moved as one item

Alternatively make an PGraphics pg containing the image and the text. Then just move the pg

2 Likes

Thank u v.much :yellow_heart: :yellow_heart: :yellow_heart:

1 Like

Hello,

Welcome to the Processing forum.

There are examples in the Processing IDE (File > Examples…)

Using this one:
image

Add to setup:

textSize(24);

Add a line to display text after the image:

text("Space: The final frontier.", width-400, 50);

And voila!

image

References:

:)

1 Like