本文整理匯總了Java中processing.core.PGraphics.endDraw方法的典型用法代碼示例。如果您正苦於以下問題:Java PGraphics.endDraw方法的具體用法?Java PGraphics.endDraw怎麽用?Java PGraphics.endDraw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PGraphics
的用法示例。
在下文中一共展示了PGraphics.endDraw方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadNoTextureTexture
import processing.core.PGraphics; //導入方法依賴的package包/類
private static void loadNoTextureTexture(int size){
PGraphics pg = Public.p.createGraphics(size, size);
pg.beginDraw();
pg.translate(pg.width/2, pg.height/2);
pg.rectMode(PConstants.CENTER);
pg.fill(229,22,215);
pg.rect(-size/2, -size/2,size,size);
pg.fill(0,0,0);
pg.rect(size/2, -size/2,size,size);
pg.fill(229,22,215);
pg.rect(size/2, size/2,size,size);
pg.fill(0,0,0);
pg.rect(-size/2, size/2,size,size);
pg.fill(255,255,255);
pg.textSize(11);
pg.text("TEXTURE", -size/2+PApplet.map(size, 50, 100, 0, 26), -10);
pg.text("NOT", -size/2+pg.textWidth("NOT")/2+PApplet.map(size, 50, 100, 0, 26), 5);
pg.text("FOUND", -(size/2-pg.textWidth("FOUND")/6)+PApplet.map(size, 50, 100, 0, 26), 20);
pg.endDraw();
noTextureTexture = pg.get();
}
示例2: 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();
}
示例3: finishDraw
import processing.core.PGraphics; //導入方法依賴的package包/類
private void finishDraw(PGraphics pg){
pg.popStyle();
pg.popMatrix();
if(pg != parent.g) pg.endDraw();
}
示例4: toImage
import processing.core.PGraphics; //導入方法依賴的package包/類
public void toImage(int n){
if(n >= 0 && n < this.layer.length){
Layer l = this.layer[n];
int fw = this.camwidth;
int fh = this.camheight;
int ml = this.camleft;
int mt = this.camtop;
boolean v = l.visible;
PGraphics conv;
l.visible = true;
this.camleft = 0;
this.camtop = 0;
switch(this.orientation){
case "orthogonal":
this.camwidth = this.mapwidth * this.tilewidth;
this.camheight = this.mapheight * this.tileheight;
break;
case "isometric":
this.camwidth = (this.mapwidth + this.mapheight) * this.tilewidth / 2;
this.camheight = (this.mapwidth + this.mapheight) * this.tileheight / 2;
break;
case "staggered":
case "hexagonal":
if(this.staggeraxis.equals("x")){
this.camwidth = (this.mapwidth + 1) * (this.hexsidelength + this.tilewidth) / 2;
this.camheight = (this.mapheight + 1) * (this.hexsidelength + this.tileheight);
}
else{
this.camwidth = (this.mapwidth + 1) * (this.hexsidelength + this.tilewidth);
this.camheight = (this.mapheight + 1) * (this.hexsidelength + this.tileheight) / 2;
}
break;
}
conv = parent.createGraphics(this.camwidth, this.camheight);
conv.beginDraw();
this.drawLayer(conv, n);
conv.endDraw();
l.image = conv;
l.data = null;
l.objects = null;
l.type = "imagelayer";
l.visible = v;
l.offsetx = 0;
l.offsety = 0;
this.camwidth = fw;
this.camheight = fh;
this.camleft = ml;
this.camtop = mt;
}
}