growing的 字母 然后有button可以控制 要怎么用array ...
2019-04-305358
AI 快速预览详细
本文介绍了如何在Processing中使用数组和按钮控制字母的生长动画。通过数组存储和更新字母状态,逐步叠加装饰细节,实现平滑的动画效果。文章提供了详细的代码示例,适合零基础新手学习。
|
在一开始的时候字母就只是普通的样子没有身上的装饰。随着不断叠加第三个营养元素的时候的那些装饰才慢慢出来 参考我给的例子字母 void drawA(float x, float y, color cl) { pushMatrix(); translate(x, y); fill(cl); strokeWeight(outline/20); stroke(#31302E); // letter A beginShape(); vertex(0, 0); vertex(unit/2, 0); vertex(unit*4, tall*10); vertex(aside02*3, tall*10); vertex(aside*2.5, amiddle*8.5); vertex(0 - aside*2.5, amiddle*8.5); vertex(0 - aside02*3, tall*10); vertex(0 - unit*4, tall*10); vertex(0 - unit/2, 0); beginContour(); // inside A vertex(0, tall*2); vertex(0 - aside*1.5, amiddle*7); vertex(aside*1.5, amiddle*7); endContour(); endShape(CLOSE); popMatrix(); } void drawAd(float x, float y, color cl) { pushMatrix(); translate(x, y); fill(cl); //stroke(color(57,181,74)); strokeWeight(1); beginShape(); //vertex(0,tall); vertex(unit/4, tall); vertex(unit*3, tall*10); vertex(aside02*3, tall*10); vertex(aside*2.5, amiddle*8.5); vertex(0 - aside*2.5, amiddle*8.5); vertex(0 - aside02*3, tall*10); vertex(0 - unit*3, tall*10); vertex(0 - unit/4, tall); beginContour(); // inside A vertex(0, tall*2); vertex(0 - aside*1.5, amiddle*7); vertex(aside*1.5, amiddle*7); endContour(); endShape(CLOSE); popMatrix(); } |
-
finat w1.png (218.47 KB, 下载次数: 5527)






arraylist 是 java 列表接口的可调整大小的数组实现。它有许多用于控制和搜索其内容的方法。例如, arraylist 的长度由其大小 () 方法返回, 它是列表中元素总数的整数值。使用 add () 方法将元素添加到 arraylist 中, 并使用 remove () 方法将其删除。获取 () 方法返回列表中指定位置处的元素。(请参见上面的上下文示例。