本文整理匯總了Java中processing.core.PGraphics.ellipse方法的典型用法代碼示例。如果您正苦於以下問題:Java PGraphics.ellipse方法的具體用法?Java PGraphics.ellipse怎麽用?Java PGraphics.ellipse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PGraphics
的用法示例。
在下文中一共展示了PGraphics.ellipse方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderProcessing
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public void renderProcessing(Item item, ProcessingTarget target, PreviewProperties properties) {
Float x = item.getData(NodeItem.X);
Float y = item.getData(NodeItem.Y);
Float size = item.getData(NodeItem.SIZE);
Color color = item.getData(NodeItem.COLOR);
int alpha = (int) ((properties.getFloatValue(PreviewProperty.NODE_OPACITY) / 100f) * 255f);
if (alpha > 255) {
alpha = 255;
}
PGraphics graphics = target.getGraphics();
graphics.fill(color.getRed(), color.getGreen(), color.getBlue(), alpha);
if (size > 21) {
logger.print(size);
Color stC = color.darker().darker().darker();
graphics.stroke(stC.getRed(), stC.getGreen(), stC.getBlue(), alpha);
graphics.strokeWeight(3f);
graphics.ellipse(x, y, size, size);
} else {
graphics.stroke(color.getRed(), color.getGreen(), color.getBlue(), alpha);
graphics.strokeWeight(1f);
graphics.ellipse(x, y, size, size);
}
}
示例2: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 4);
PGraphics pg = (PGraphics) params.get(0);
pg.ellipse(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue(),
((Number) params.get(4)).floatValue()
);
stack.push(pg);
return stack;
}
示例3: drawEarthquake
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public void drawEarthquake(PGraphics pg, float x, float y) {
// IMPLEMENT: drawing circle for LandQuake
// DO NOT set the fill color. That will be set in the EarthquakeMarker
// class to indicate the depth of the earthquake.
// Simply draw a centered square.
// HINT: Notice the radius variable in the EarthquakeMarker class
// and how it is set in the EarthquakeMarker constructor
pg.ellipse(x, y, 2*radius, 2*radius);
}
示例4: drawLight
import processing.core.PGraphics; //導入方法依賴的package包/類
/**
* Draw light spots on lightMap.
* @param x
* @param y
* @param Width
* @param Height
* @param brightness
* @param pg
*/
private static void drawLight(int x, int y, int Width, int Height, int brightness, PGraphics pg) {
pg.beginDraw();
pg.noStroke();
pg.fill(255, brightness / 4);
for (int i = 0; i < 10; i++) {
pg.ellipse(x, y, Width / (i + 1), Height / (i + 1));
}
pg.endDraw();
}
示例5: drawMarker
import processing.core.PGraphics; //導入方法依賴的package包/類
private void drawMarker(PGraphics pGraphics, float x, float y) {
pGraphics.pushStyle();
pGraphics.noStroke();
pGraphics.fill(128, 255, 128, 200);
pGraphics.ellipse(x, y, MARKER_SIZE, MARKER_SIZE);
pGraphics.popStyle();
}
示例6: drawEarthquake
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public void drawEarthquake(PGraphics pg, float x, float y) {
pg.ellipse(x, y, 2*radius, 2*radius);
}
示例7: 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();
}
}
示例8: drawEarthquake
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public void drawEarthquake(PGraphics pg, float x, float y) {
pg.ellipse(x, y, 2*radius, 2*radius);
}
示例9: drawEarthquake
import processing.core.PGraphics; //導入方法依賴的package包/類
/** Draw the earthquake as an ellipse */
@Override
public void drawEarthquake(PGraphics pg, float x, float y) {
pg.ellipse(x, y, 2*radius, 2*radius);
}
示例10: drawSelf
import processing.core.PGraphics; //導入方法依賴的package包/類
public void drawSelf(PGraphics g, int size) {
for (int i = 0; i < 8; i += 2) {
g.ellipse((float) corners[i], (float) corners[i + 1], size, size);
}
}
示例11: drawMarker
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public void drawMarker(PGraphics pg, float x, float y) {
pg.fill(11);
pg.ellipse(x, y, 5, 5);
}