当前位置: 首页>>代码示例>>Java>>正文


Java Graphic.fillRect方法代码示例

本文整理汇总了Java中br.com.etyllica.core.graphics.Graphic.fillRect方法的典型用法代码示例。如果您正苦于以下问题:Java Graphic.fillRect方法的具体用法?Java Graphic.fillRect怎么用?Java Graphic.fillRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在br.com.etyllica.core.graphics.Graphic的用法示例。


在下文中一共展示了Graphic.fillRect方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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);		
}
 
开发者ID:yuripourre,项目名称:htbm-v2,代码行数:21,代码来源:StreetTile.java

示例2: drawFill

import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
private void drawFill(Graphic g, int connectorSize, int offset) {
  double percent = battery.getLevel() / battery.getScale();

  int division = ((h - connectorSize - offset * 2) / 4);

  int startFill = y + connectorSize + offset;
  int fillOffset = division + offset - 1;

  if (percent > 0.75) {
    g.fillRect(x + offset, startFill, w - offset - 1, division);
  }

  if (percent > 0.50) {
    g.fillRect(x + offset, startFill + fillOffset, w - offset - 1, division);
  }

  if (percent > 0.25) {
    g.fillRect(x + offset, startFill + fillOffset * 2, w - offset - 1, division);
  }

  if (percent > 0) {
    g.fillRect(x + offset, startFill + fillOffset * 3, w - offset - 1, division + 1);
  }

  if (percent == 0) {
    g.setColor(Color.RED);
    g.drawLine(x + offset, startFill + fillOffset * 3 + division, x + w - offset, startFill
        + fillOffset * 3 + division);
  }
}
 
开发者ID:yuripourre,项目名称:drone4,代码行数:31,代码来源:BatteryIndicator.java

示例3: drawLines

import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
private void drawLines(Graphic g){

		g.setColor(Color.BLACK);

		//Draw Line
		int lineWidth = 10;
		g.fillRect(w/2-lineWidth/2, 0, lineWidth, h);
				
		//Drawing Score
		g.setFont(g.getFont().deriveFont(22f));
		g.write(w/2-80, 50, Integer.toString(paddle1.getScore()));
		g.write(w/2+80, 50, Integer.toString(paddle2.getScore()));

	}
 
开发者ID:yuripourre,项目名称:etyllic-pong,代码行数:15,代码来源:PongApplication.java

示例4: 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);
		}			
		
	}		

}
 
开发者ID:yuripourre,项目名称:multiplayer,代码行数:20,代码来源:ClientApplication.java

示例5: draw

import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {
	g.setColor(Color.BLUE);
	g.fillRect(0, 0, 800, 200);
}
 
开发者ID:yuripourre,项目名称:htbm-v2,代码行数:6,代码来源:BackgroundTile.java

示例6: draw

import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {
	
	background.draw(g);
	
	g.setColor(Color.BLACK);
	g.setAlpha(40);
	g.fillRect(20, 0, w-40, h);
	g.setAlpha(100);
	
	g.setFont(g.getFont().deriveFont(32f).deriveFont(Font.BOLD));
	
	g.setColor(Color.WHITE);
	
	g.drawStringShadowX(50, "Credits");
	
	g.drawStringShadowX(250, "Pedro Viriato - Art");
	g.drawStringShadowX(300, "Rafael Bastos - Sounds");
	g.drawStringShadowX(350, "Yuri Pourre - Programming");
	
		
}
 
开发者ID:yuripourre,项目名称:htbm-v2,代码行数:23,代码来源:Credits.java

示例7: draw

import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {
	
	background.draw(g);
	
	g.setColor(Color.BLACK);
	g.setAlpha(40);
	g.fillRect(20, 0, w-40, h);
	g.setAlpha(100);
	
	g.setFont(g.getFont().deriveFont(32f).deriveFont(Font.BOLD));
	
	g.setColor(Color.WHITE);
	
	g.drawStringShadowX(50, "Instructions");
	
	g.setFont(g.getFont().deriveFont(28f).deriveFont(Font.BOLD));		
	
	g.drawStringShadowX(110, "Use Q,A,P, and L keys to beat your heart");
	
	
	g.drawStringShadowX(180, "Q beats the Upper Left part of Heart.");
	g.drawStringShadowX(220, "A beats the Lower Left part of Heart.");
	g.drawStringShadowX(260, "P beats the Upper Right part of Heart.");
	g.drawStringShadowX(300, "L beats the Lower Right part of Heart.");
	
}
 
开发者ID:yuripourre,项目名称:htbm-v2,代码行数:28,代码来源:Instructions.java

示例8: 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);
	
}
 
开发者ID:yuripourre,项目名称:htbm-v2,代码行数:13,代码来源:LoadingGame.java

示例9: draw

import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {
	
	g.setColor(color);
	
	g.fillRect(x, y, w, h);
	
}
 
开发者ID:yuripourre,项目名称:etyllic-pong,代码行数:9,代码来源:Ball.java

示例10: draw

import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {

	g.setColor(Color.BLACK);

	g.fillRect(x, y, w, h);

}
 
开发者ID:yuripourre,项目名称:etyllic-pong,代码行数:9,代码来源:Paddle.java

示例11: draw

import br.com.etyllica.core.graphics.Graphic; //导入方法依赖的package包/类
@Override
public void draw(Graphic g) {

	g.setColor(Color.WHITE);
	g.fillRect(0, 0, w, h);

	drawLines(g);

	paddle1.draw(g);
	paddle2.draw(g);
	ball.draw(g);

}
 
开发者ID:yuripourre,项目名称:etyllic-pong,代码行数:14,代码来源:PongApplication.java


注:本文中的br.com.etyllica.core.graphics.Graphic.fillRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。