本文整理匯總了Java中processing.core.PApplet.stroke方法的典型用法代碼示例。如果您正苦於以下問題:Java PApplet.stroke方法的具體用法?Java PApplet.stroke怎麽用?Java PApplet.stroke使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PApplet
的用法示例。
在下文中一共展示了PApplet.stroke方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawNoisy
import processing.core.PApplet; //導入方法依賴的package包/類
void drawNoisy(PApplet ap)
{
if(this.color != Color.WHITE)
{
//System.out.println(this.edges);
ap.beginShape();
for (Edge e : edges)
{
ap.stroke(colorToInt(biomesColor[5]));
ap.strokeWeight(e.strokeWeight);
t += 0.01f;
if (e.f1 == this)
{
if (e.noisy1 == null || e.noisy2 == null) {
ap.vertex(e.p1.pos.x, e.p1.pos.y);
ap.vertex(e.p2.pos.x, e.p2.pos.y);
} else {
drawPathForwards(ap, e.noisy1);
drawPathBackwards(ap, e.noisy2);
}
} else { // reverse order
if (e.noisy1 == null || e.noisy2 == null) {
ap.vertex(e.p2.pos.x, e.p2.pos.y);
ap.vertex(e.p1.pos.x, e.p1.pos.y);
} else {
drawPathForwards(ap, e.noisy2);
drawPathBackwards(ap, e.noisy1);
}
}
}
ap.endShape(ap.CLOSE);
}
}
示例2: stroke
import processing.core.PApplet; //導入方法依賴的package包/類
public void stroke(PApplet gc){
gc.stroke(r, g, b);
}
示例3: draw
import processing.core.PApplet; //導入方法依賴的package包/類
void draw(PApplet ap) {
ap.smooth();
ap.background(colorToInt(this.color(0, 0, 0)));
if (created) {
ap.background(colorToInt(Color.WHITE));
ap.smooth();
for (int i = 0; i < voronoiPoints.size(); i++)
ap.point(voronoiPoints.get(i).x, voronoiPoints.get(i).y);
for (int i = 0; i < facesList.size(); i++)
{
ap.fill(colorToInt(facesList.get(i).color));
//facesList.get(i).drawSimple(ap);
facesList.get(i).drawNoisy(ap);
}
ap.fill(0);
ap.stroke(0, 90);
if(showText)
{
ap.textSize(14);
for (int i = 0; i < facesList.size(); i++)
{
ap.text(i + "", facesList.get(i).pos.x, facesList.get(i).pos.y);
}
}
ap.stroke(50, 150, 50,120);
if(drawBorders)
{
for (int i = 0; i < facesList.size(); i++)
{
ArrayList<Face> neighbors = facesList.get(i).neighbours;
for (int j = 0; j < neighbors.size(); j++) {
ap.line(facesList.get(i).pos.x, facesList.get(i).pos.y, neighbors.get(j).pos.x,
neighbors.get(j).pos.y);
}
}
}
}
}