本文整理匯總了Java中processing.core.PGraphics.background方法的典型用法代碼示例。如果您正苦於以下問題:Java PGraphics.background方法的具體用法?Java PGraphics.background怎麽用?Java PGraphics.background使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PGraphics
的用法示例。
在下文中一共展示了PGraphics.background方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: prepareDraw
import processing.core.PGraphics; //導入方法依賴的package包/類
private void prepareDraw(PGraphics pg, float left, float top){
this.camwidth = pg.width;
this.camheight = pg.height;
if(this.positionmode.equals("MAP")){
PVector p = this.mapToCanvas(left, top);
left = p.x;
top = p.y;
}
if(this.drawmode == 3){
this.camleft = parent.floor(left - this.camwidth / 2);
this.camtop = parent.floor(top - this.camheight / 2);
}
else{
this.camleft = parent.floor(left);
this.camtop = parent.floor(top);
}
if(pg != parent.g) pg.beginDraw();
pg.pushMatrix();
pg.resetMatrix();
pg.pushStyle();
pg.imageMode(parent.CORNER);
switch(this.backgroundmode) {
case "COLOR":
pg.background(this.backgroundcolor);
break;
case "CLEAR":
if(pg != parent.g) pg.clear();
else pg.background(this.backgroundcolor);
break;
}
}
示例2: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 1, 2, 3, 4);
PGraphics pg = (PGraphics) params.get(0);
if (2 == params.size()) {
if (params.get(1) instanceof Long) {
pg.background(
((Number) params.get(1)).intValue()
);
} else if (params.get(1) instanceof Double) {
pg.background(
((Number) params.get(1)).floatValue()
);
} else if (params.get(1) instanceof PImage) {
pg.background((PImage) params.get(1));
}
} else if (3 == params.size()) {
if (params.get(1) instanceof Long) {
pg.background(
((Number) params.get(1)).intValue(),
((Number) params.get(2)).floatValue()
);
} else if (params.get(1) instanceof Double) {
pg.background(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue()
);
}
} else if (4 == params.size()) {
pg.background(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue()
);
} else if (5 == params.size()) {
pg.background(
((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: displayScene
import processing.core.PGraphics; //導入方法依賴的package包/類
public void displayScene(PGraphics canvas){
if(canvas == skylight.renderer.pg_render){
canvas.background(32);
}
canvas.shape(shape);
}