本文整理汇总了Java中br.com.etyllica.core.graphics.Graphic.drawRect方法的典型用法代码示例。如果您正苦于以下问题:Java Graphic.drawRect方法的具体用法?Java Graphic.drawRect怎么用?Java Graphic.drawRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类br.com.etyllica.core.graphics.Graphic
的用法示例。
在下文中一共展示了Graphic.drawRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {
g.setColor(Color.GREEN);
int connectorSize = h / 12;
int offset = 2;
g.drawRect(x + w / 3, y, w / 3, connectorSize);
g.drawRect(x, y + connectorSize, w, h - connectorSize);
drawFill(g, connectorSize, offset);
g.setColor(Color.WHITE);
g.setFontSize(12f);
g.drawStringShadow(x, y - h / 2, w, h / 2, Integer.toString((int) battery.getLevel()) + "%");
}
示例2: draw
import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {
int streetH = 160;
g.setAlpha(60);
g.setColor(Color.BLACK);
g.fillRect(x,y,w,streetH);
g.setColor(Color.BLUE);
g.drawRect(x,y,w,streetH);
g.setColor(Color.GRAY);
g.fillRect(x,y+streetH,w,h-streetH);
g.setColor(Color.BLUE);
g.drawRect(x,y+streetH,w,h-streetH);
g.setAlpha(100);
}
示例3: draw
import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {
g.setColor(Color.CYAN);
g.fillRect(0, 0, w, h);
g.setColor(Color.BLACK);
for(State state: players.values()) {
g.drawRect(state.x, state.y, 50, 50);
if(sender == state.id) {
g.setColor(Color.BLACK);
g.drawString(messageText, state.x, 80);
}
}
}
示例4: draw
import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {
g.setColor(Color.WHITE);
g.drawStringShadowX(320, phrase);
g.drawRect(rectX, rectY, rectW, rectH);
g.fillRect(rectX+2, rectY+2, (int)((rectW*fill)/100)-3, rectH-3);
g.drawStringShadow(rectX, rectY, rectW, rectH, percent, Color.BLACK);
}