本文整理匯總了Java中processing.core.PGraphics.noFill方法的典型用法代碼示例。如果您正苦於以下問題:Java PGraphics.noFill方法的具體用法?Java PGraphics.noFill怎麽用?Java PGraphics.noFill使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PGraphics
的用法示例。
在下文中一共展示了PGraphics.noFill方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: displayParticles
import processing.core.PGraphics; //導入方法依賴的package包/類
static public void displayParticles(PGraphics pg, World world) {
int particle_num = world.getParticleCount();
if (particle_num != 0) {
float radius = world.getParticleRadius();
radius *= PARTICLE_RADIUS_SCALE;
Vec2[] particle_pos = world.getParticlePositionBuffer();
pg.beginShape(PConstants.QUADS);
pg.noFill();
pg.noStroke();
pg.textureMode(PConstants.NORMAL);
pg.texture(PARTICLE_SPRITE);
for (int i = 0; i < particle_num; i++) {
Vec2 pos = particle_pos[i];
pg.vertex(pos.x - radius, pos.y - radius, 0, 0);
pg.vertex(pos.x + radius, pos.y - radius, 1, 0);
pg.vertex(pos.x + radius, pos.y + radius, 1, 1);
pg.vertex(pos.x - radius, pos.y + radius, 0, 1);
}
pg.endShape();
}
}
示例2: drawCutOffMax
import processing.core.PGraphics; //導入方法依賴的package包/類
void drawCutOffMax(PGraphics gx)
{
float cutoff = (float)m_Framework.getGroup(m_iGroupIndex, true).m_CutOffMax;
float thresholdLineY = m_LargeRect.bottom() - m_LargeRect.height() * (cutoff - 1 + m_ZoomCoord.bottom()) / (m_ZoomCoord.bottom() - m_ZoomCoord.top());
float topVal = 1 - m_ScrollY.value();
float bottomVal = 1 - (m_ScrollY.value() + m_ScrollY.getVisibleAmount());
float gradTop = cutoff > topVal ? m_CuttOffRect.top() : thresholdLineY;
DrawUtils.gradientRect(gx, (int)m_CuttOffRect.left(), (int)gradTop,
m_CuttOffRect.width(), m_CuttOffRect.bottom() - gradTop,
gx.lerpColor(dp.hmColor0, dp.hmColor1, cutoff > topVal ? topVal / cutoff : 1),
gx.lerpColor(dp.hmColor0, dp.hmColor1, bottomVal / cutoff),
DrawUtils.Y_AXIS);
gx.noFill();
gx.rect(m_CuttOffRect.left(), m_CuttOffRect.top(), m_CuttOffRect.width(), m_CuttOffRect.height());
if (1 - cutoff > m_ZoomCoord.top() && 1 - cutoff < m_ZoomCoord.bottom())
{// draw the cuttoff max line
gx.strokeWeight(3);
gx.line(m_CuttOffRect.left(), thresholdLineY, m_CuttOffRect.right(), thresholdLineY);
}
}
示例3: drawSmallPlot
import processing.core.PGraphics; //導入方法依賴的package包/類
void drawSmallPlot(PGraphics gx)
{
// draw the small plot image on the top right corner
gx.fill(255);
gx.stroke(0);
gx.strokeWeight(1);
gx.rect(m_SmallRect.left()-1, m_SmallRect.top()-1, m_SmallRect.width()+2, m_SmallRect.height()+2); // border
if (!m_ShowSummary)
{
m_CDisplay.drawPlot(gx, dp, m_ClustInfo, m_iGroupIndex, m_SmallRect);
}
else
{
gx.stroke(128);
gx.strokeWeight(2);
m_CDisplay.drawSummaryPlot(gx, dp, m_ClustInfo, m_SmallRect, -1, false);
}
// shade the non-visible regions in the small plot image;
gx.fill(0, 40);
gx.noStroke();
Rect visibleRect = new Rect(m_SmallRect.left() + m_ZoomCoord.left() * m_SmallRect.width(),
m_SmallRect.top() + m_ZoomCoord.top() * m_SmallRect.height(),
m_ZoomCoord.width() * m_SmallRect.width(),
m_ZoomCoord.height() * m_SmallRect.height());
gx.rect(m_SmallRect.left(), m_SmallRect.top(), visibleRect.left() - m_SmallRect.left(), m_SmallRect.height());
gx.rect(visibleRect.left(), m_SmallRect.top(), visibleRect.width(), visibleRect.top() - m_SmallRect.top());
gx.rect(visibleRect.left(), visibleRect.bottom(), visibleRect.width(), m_SmallRect.bottom() - visibleRect.bottom());
gx.rect(visibleRect.right(), m_SmallRect.top(), m_SmallRect.right() - visibleRect.right(), m_SmallRect.height());
gx.noFill();
gx.stroke(0);
gx.rect(visibleRect.left(), visibleRect.top(), visibleRect.width(), visibleRect.height());
}
示例4: display
import processing.core.PGraphics; //導入方法依賴的package包/類
public void display(PGraphics pg_canvas, int x, int y){
setDisplayPosition(x, y);
pg_canvas.image(pg_region, x, y, w, h);
pg_canvas.rectMode(PConstants.CORNER);
pg_canvas.stroke(128);
pg_canvas.strokeWeight(1);
pg_canvas.noFill();
pg_canvas.rect(x, y, w, h);
}
示例5: drawLayer
import processing.core.PGraphics; //導入方法依賴的package包/類
private void drawLayer(PGraphics pg, int m){
int tileoffsetx, tileoffsety, n, dif;
float x = 0, y = 0;
Layer l = this.layer[m];
switch(l.type){
case "layer":
map.drawTileLayer(pg, m);
break;
case "imagelayer":
pg.image(l.image, -this.camleft + l.offsetx, -this.camtop + l.offsety);
break;
case "objectgroup":
pg.fill(l.objcolor);pg.stroke(l.objcolor); pg.strokeWeight(1);
for(StringDict o: l.objects){
if(!o.hasKey("visible")){
pg.pushMatrix();
pg.resetMatrix();
pg.pushStyle();
pg.ellipseMode(parent.CORNER);
pg.translate(parent.parseFloat(o.get("x")) - l.offsetx - this.camleft, parent.parseFloat(o.get("y"))- l.offsety - this.camtop);
if(o.hasKey("rotation")) pg.rotate(parent.parseFloat(o.get("rotation")) * parent.PI / 180);
switch(o.get("object")){
case "rectangle":
pg.rect(0, 0, parent.parseFloat(o.get("width")), parent.parseFloat(o.get("height")));
break;
case "ellipse":
pg.ellipse(0, 0, parent.parseFloat(o.get("width")), parent.parseFloat(o.get("height")));
break;
case "tile":
if(o.hasKey("rotation")) pg.rotate(-parent.parseFloat(o.get("rotation")) * parent.PI / 180);
pg.translate(0, -this.tile[parent.parseInt(o.get("gid")) - 1].image.height);
if(o.hasKey("rotation")) pg.rotate(parent.parseFloat(o.get("rotation")) * parent.PI / 180);
pg.image(this.tile[parent.parseInt(o.get("gid")) - 1].image, this.tile[parent.parseInt(o.get("gid")) - 1].offsetx, this.tile[parent.parseInt(o.get("gid")) - 1].offsety, parent.parseFloat(o.get("width")), parent.parseFloat(o.get("height")));
break;
case "polygon":
case "polyline":
if(o.get("object").equals("polyline")) pg.noFill();
pg.beginShape();
for(String s: parent.split(o.get("points"), " ")){
float [] p = parent.parseFloat(parent.split(s, ","));
pg.vertex(p[0], p[1]);
}
if(o.get("object").equals("polyline")) pg.endShape(); else pg.endShape(parent.CLOSE);
break;
}
pg.popStyle();
pg.popMatrix();
}
}
break;
}
if(pg != parent.g && l.opacity < 1){//applyOpacity
pg.loadPixels();
int a = parent.parseInt(parent.map(l.opacity, 0, 1, 1, 255));
for (int p = 0; p < pg.pixels.length; p++) if(parent.alpha(pg.pixels[p]) > a) pg.pixels[p] = parent.color(parent.red(pg.pixels[p]), parent.green(pg.pixels[p]), parent.blue(pg.pixels[p]), a);
pg.updatePixels();
}
}
示例6: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 0);
PGraphics pg = (PGraphics) params.get(0);
pg.noFill();
stack.push(pg);
return stack;
}