• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java GradientFill类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.newdawn.slick.fills.GradientFill的典型用法代码示例。如果您正苦于以下问题:Java GradientFill类的具体用法?Java GradientFill怎么用?Java GradientFill使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GradientFill类属于org.newdawn.slick.fills包,在下文中一共展示了GradientFill类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import org.newdawn.slick.fills.GradientFill; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
 */
public void init(GameContainer container) throws SlickException {
	this.container = container;

	rect = new Rectangle(400,100,200,150);
	round = new RoundedRectangle(150,100,200,150,50);
	round2 = new RoundedRectangle(150,300,200,150,50);
	center = new Rectangle(350,250,100,100);
	
	poly = new Polygon();
	poly.addPoint(400,350);
	poly.addPoint(550,320);
	poly.addPoint(600,380);
	poly.addPoint(620,450);
	poly.addPoint(500,450);
	
	gradient = new GradientFill(0,-75,Color.red,0,75,Color.yellow,true);
	gradient2 = new GradientFill(0,-75,Color.blue,0,75,Color.white,true);
	gradient4 = new GradientFill(-50,-40,Color.green,50,40,Color.cyan,true);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:23,代码来源:GradientTest.java


示例2: init

import org.newdawn.slick.fills.GradientFill; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
 */
public void init(GameContainer container) throws SlickException {
	this.container = container;
	
	image1 = new Image("testdata/grass.png");
	image2 = new Image("testdata/rocks.png");
	
	fill = new GradientFill(-64,0,new Color(1,1,1,1f),64,0,new Color(0,0,0,0));
	shape = new Rectangle(336,236,128,128);
    poly = new Polygon();
	poly.addPoint(320,220);
	poly.addPoint(350,200);
	poly.addPoint(450,200);
	poly.addPoint(480,220);
	poly.addPoint(420,400);
	poly.addPoint(400,390);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:20,代码来源:GradientImageTest.java


示例3: GUI

import org.newdawn.slick.fills.GradientFill; //导入依赖的package包/类
public GUI(GameContainer container, int x, int y) {
super(container);

setLocation(x, y);
Font buttonFont = new TrueTypeFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 14), true);
//North and south
speedUp = new TextButton(container, "Speed Up", getCompX(0), getCompY(0), buttonFont);
speedDown = new TextButton(container, "Speed Down", getCompX(speedUp.getWidth() + 30), getCompY(0), buttonFont);

pause = new TextButton(container, "Pause", getCompX(0), speedUp.getY() + speedUp.getHeight() + 10, buttonFont);
restart = new TextButton(container, "Restart", speedDown.getX(), speedUp.getY() + speedUp.getHeight() + 10, buttonFont);

euler = new TextButton(container, "Angle set: " + getAngleSet(), getCompX(0), pause.getY() + pause.getHeight() + 10, buttonFont);

hemisphere = new TextButton(container, getHemisphereText(), getCompX(0), euler.getY() + euler.getHeight() + 10, buttonFont);

close = new TextButton(container, "X", speedDown.getX() + speedDown.getWidth() + 50, getCompY(0), buttonFont);

contents = new Rectangle(x - 5, y - 5, width, height);
sf = new GradientFill(0, 0, new Color(10, 10, 10, 200), width, 0, new Color(60, 60, 60, 200));
   }
 
开发者ID:langurmonkey,项目名称:celestial-pole-motion,代码行数:22,代码来源:GUI.java


示例4: Bullet

import org.newdawn.slick.fills.GradientFill; //导入依赖的package包/类
public Bullet(Vector2f initPos){
	this.position = initPos.copy();
	this.dir = new Vector2f(0, -2);
	this.shape = new Circle(this.position.x, this.position.y, 5);
	this.fill = new GradientFill(-10, -10, Color.white, 10, 10, Color.white, true);
	this.isDestroyed = false;
}
 
开发者ID:Jullekungfu,项目名称:SpaceDefence,代码行数:8,代码来源:Bullet.java


示例5: Creep

import org.newdawn.slick.fills.GradientFill; //导入依赖的package包/类
public Creep(Vector2f initPos, Color color){
	hp = 100;
	shape = new Rectangle(0, 0, WIDTH, HEIGHT);
	shapeFill = new GradientFill(0,0, color, 20, 20, color, true);
	position = initPos;
	direction = new Vector2f(0, 0.01f*speed);
	shape.setLocation(position);
	isDestroyed = false;
}
 
开发者ID:Jullekungfu,项目名称:SpaceDefence,代码行数:10,代码来源:Creep.java


示例6: init

import org.newdawn.slick.fills.GradientFill; //导入依赖的package包/类
public void init(Vector2f centerPos, Stats stats){
	this.stats = stats;
	position = new Vector2f(centerPos.x - WIDTH/2, centerPos.y - HEIGHT/2);
	shape = new Polygon(new float[]{position.x, position.y, position.x + WIDTH/2, position.y - HEIGHT, position.x + WIDTH, position.y});
	shape.setLocation(position);
	Color color = ColorSwitch.getColorFromId(id);
	shapeFill = new GradientFill(0,0, color, 50, 50, color, true);
	direction = new Vector2f(0,0);
	gun = new Gun();
	moveTo = null;
	creeps = new HashMap<Integer, Creep>();
}
 
开发者ID:Jullekungfu,项目名称:SpaceDefence,代码行数:13,代码来源:Player.java


示例7: drawDialogBox

import org.newdawn.slick.fills.GradientFill; //导入依赖的package包/类
/**
 * Will draw a box that holds dialog
 * 
 * @param g graphics to draw the box with
 */
public void drawDialogBox(Graphics g) {
	// x: 20 y: 470 width: 960 height: 640 - 470
	// g.drawRect(20, 470, 960, 170);
	g.fill(new Rectangle(20, 470, 960, 170), new GradientFill(20f, 470f,
			transparentGrey, 980f, 660f, transparentGrey));
}
 
开发者ID:BradleyCai,项目名称:VN-RW,代码行数:12,代码来源:VNTool.java



注:本文中的org.newdawn.slick.fills.GradientFill类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XmlSlurper类代码示例发布时间:2022-05-22
下一篇:
Java Element类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap