Checking clicked word
in
Programming Questions
•
1 year ago
Hi guys,
I'm making a dictionary like applet for ancient greek poetry.
I need to check what word the user clicked (or is mousing over) per line. Each line has aorund five words, with a font that is not monospaced.
I'm thinking about a solution that has the pixel size and position of each word hard coded. Any better ideas?
Here's how I'm displaying the text:
I'm making a dictionary like applet for ancient greek poetry.
I need to check what word the user clicked (or is mousing over) per line. Each line has aorund five words, with a font that is not monospaced.
I'm thinking about a solution that has the pixel size and position of each word hard coded. Any better ideas?
Here's how I'm displaying the text:
- PFont fontGreek;
- void setup() {
- size(800,600);
- fontGreek = createFont("Athens", 16, true);
- } // end setup
- void draw() {
- background (255);
- textFont(fontGreek); fill(0);
- text("Ζεὺς μὲν ἀφίκτωρ ἐπίδοι προφρόνως\n"+
- "στόλον ἡμέτερον νάιον ἀρθέντ᾽\n" ,20, 60);
- } // end draw
1