Scaling a shape made with Geomerative
in
Contributed Library Questions
•
11 months ago
Hi,
I have a problem scaling a shape made via Geomerative.
I used beginShape and endShape to modify a font and I want to modify the x scale and y scale of the result.
Here is my actual code, without the scaling which doesn't work any way.
If any of you have an idea
-
void drawLetter (){if (key == ENTER){nextLine ();}else if (key != TAB && key != BACKSPACE && keyCode != SHIFT && keyCode != ALT && keyCode != UP && keyCode != DOWN && keyCode != RIGHT && keyCode != LEFT && keyCode != CONTROL && keyCode != 157 && keyCode != 20){translate (width-(width-50)+letterWidth, height-(height-100)+jumpLine);// Reset the letter pointer to nullletter = null;// Create a string from the charchar theLetter[] = {key};String st = new String (theLetter);// Create the letter shapeletter = RG.getText ( st , "Times New Roman.ttf", 80, CENTER);// Get the pointspoints = letter.getPoints ();if (points != null){for (int i = 0; i < points.length; i++){// Randomly add -1.5 ... 1.5 to each X & Y, on each pointpoints[i].x += random (1.5)-.75;points[i].y += random (1.5)-.75;}// Create the shapebeginShape ();for (int i=0; i<points.length; i++){vertex (points[i].x, points[i].y);}endShape ();}firstLetterWidth = 40;letterWidth += firstLetterWidth;}}
Thanks
1