Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PFont fnt1;
- String myText = "To be or not to be.";
- int myFontSize = 48;
- void setup(){
- size( 600, 600 );
- fnt1 = createFont("Times New Roman", myFontSize ); fill( 0 ); // black
- textAlign( LEFT, TOP );
- textFont( fnt1 );
- }
- void draw() {
- background(127);
- text( myText, mouseX, mouseY );
- // Top horizontal line.
- line(0, mouseY, width, mouseY);
- // Bottom horizontal line.
- line(0, mouseY+myFontSize, width, mouseY+myFontSize);
- // Left vertical line.
- line(mouseX, 0, mouseX, height);
- // Right vertical line.
- line(mouseX+textWidth(myText), 0, mouseX+textWidth(myText), height);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement