本文整理匯總了Java中processing.core.PGraphics.triangle方法的典型用法代碼示例。如果您正苦於以下問題:Java PGraphics.triangle方法的具體用法?Java PGraphics.triangle怎麽用?Java PGraphics.triangle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類processing.core.PGraphics
的用法示例。
在下文中一共展示了PGraphics.triangle方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: apply
import processing.core.PGraphics; //導入方法依賴的package包/類
@Override
public Object apply(WarpScriptStack stack) throws WarpScriptException {
List<Object> params = ProcessingUtil.parseParams(stack, 6);
PGraphics pg = (PGraphics) params.get(0);
pg.triangle(
((Number) params.get(1)).floatValue(),
((Number) params.get(2)).floatValue(),
((Number) params.get(3)).floatValue(),
((Number) params.get(4)).floatValue(),
((Number) params.get(5)).floatValue(),
((Number) params.get(6)).floatValue()
);
stack.push(pg);
return stack;
}
示例2: drawMarker
import processing.core.PGraphics; //導入方法依賴的package包/類
/**
* 在地圖上繪製標記
*/
public void drawMarker(PGraphics pg, float x, float y) {
// 保存之前的繪製風格
pg.pushStyle();
// 為每個城市繪製一個三角形標記
pg.fill(150, 30, 30);
pg.triangle(x, y-TRI_SIZE, x-TRI_SIZE, y+TRI_SIZE, x+TRI_SIZE, y+TRI_SIZE);
// 恢複之前的繪製風格
pg.popStyle();
}
示例3: drawMarker
import processing.core.PGraphics; //導入方法依賴的package包/類
/**
* Implementation of method to draw marker on the map.
*/
public void drawMarker(PGraphics pg, float x, float y) {
// Save previous drawing style
pg.pushStyle();
//draw a triangle for each city
pg.fill(150, 30, 30);
pg.triangle(x, y-TRI_SIZE, x-TRI_SIZE, y+TRI_SIZE, x+TRI_SIZE, y+TRI_SIZE);
// Restore previous drawing style
pg.popStyle();
}
示例4: drawMarker
import processing.core.PGraphics; //導入方法依賴的package包/類
/**
* Implementation of method to draw marker on the map.
*/
public void drawMarker(PGraphics pg, float x, float y) {
//System.out.println("Drawing a city");
// Save previous drawing style
pg.pushStyle();
// IMPLEMENT: drawing triangle for each city
pg.fill(150, 30, 30);
pg.triangle(x, y-TRI_SIZE, x-TRI_SIZE, y+TRI_SIZE, x+TRI_SIZE, y+TRI_SIZE);
// Restore previous drawing style
pg.popStyle();
}
示例5: draw
import processing.core.PGraphics; //導入方法依賴的package包/類
/**
* Implementation of method to draw marker on the map.
*/
public void draw(PGraphics pg, float x, float y) {
// Save previous drawing style
pg.pushStyle();
// IMPLEMENT: drawing triangle for each city
pg.fill(150, 30, 30);
pg.triangle(x, y-TRI_SIZE, x-TRI_SIZE, y+TRI_SIZE, x+TRI_SIZE, y+TRI_SIZE);
// Restore previous drawing style
pg.popStyle();
}