當前位置: 首頁>>代碼示例>>Java>>正文


Java Texture.getImageWidth方法代碼示例

本文整理匯總了Java中org.newdawn.slick.opengl.Texture.getImageWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java Texture.getImageWidth方法的具體用法?Java Texture.getImageWidth怎麽用?Java Texture.getImageWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.newdawn.slick.opengl.Texture的用法示例。


在下文中一共展示了Texture.getImageWidth方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setup

import org.newdawn.slick.opengl.Texture; //導入方法依賴的package包/類
/**
 * Setup.
 *
 * @param u the u
 * @return the shader args
 */
public static ShaderArgs setup(FightUnit u) {
	Unit unit = u.getUnit();
	ShaderArgs args = new ShaderArgs();
	if(unit.getTheClass().name.equals("Lord")) return args;
	String c = unit.functionalClassName();
	
	Texture t = palettes.get(c);
	if(t == null) return args;
	if(lookup.get(c) == null) return args;
	int offset = lookup.get(c).indexOf(unit.name);
	if(offset < 0) return args;
	args.programName = "paletteSwap";
	args.args = new float[] {t.getTextureWidth(), t.getTextureHeight(), offset, t.getImageWidth()};
	GL13.glActiveTexture(GL13.GL_TEXTURE8);
	t.bind();
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	return args;
}
 
開發者ID:eliatlarge,項目名稱:FEMultiPlayer-V2,代碼行數:25,代碼來源:PaletteSwapper.java

示例2: Animation

import org.newdawn.slick.opengl.Texture; //導入方法依賴的package包/類
/**
 * Instantiates a new single-frame animation.
 *
 * @param t the texture
 * @param blend the blend mode to use when drawing this animation
 */
public Animation(Texture t, BlendModeArgs blend) {
	texture = t;
	width = t.getImageWidth();
	height = t.getImageHeight();
	length = 1;
	rows = 1;
	columns = 1;
	speed = 0;
	currentFrame = 0;
	counter = 0;
	this.blend = blend;
}
 
開發者ID:eliatlarge,項目名稱:FEMultiPlayer-V2,代碼行數:19,代碼來源:Animation.java

示例3: Button

import org.newdawn.slick.opengl.Texture; //導入方法依賴的package包/類
public Button(String name, Texture texture, int x, int y) {
	this.name = name;
	this.texture = texture;
	this.x = x;
	this.y = y;
	this.width = texture.getImageWidth();
	this.height = texture.getImageHeight();
}
 
開發者ID:massm039,項目名稱:SRPG,代碼行數:9,代碼來源:Button.java

示例4: colorAt

import org.newdawn.slick.opengl.Texture; //導入方法依賴的package包/類
public static Vector3f colorAt(int x, int y, Texture tex){
    byte[] texData = tex.getTextureData();
    int red   = texData[ (y * tex.getImageWidth() + x) * 3 ];
    int green = texData[ (y * tex.getImageWidth() + x) * 3 + 1 ];
    int blue  = texData[ (y * tex.getImageWidth() + x) * 3 + 2 ];
    return new Vector3f( (red > 0) ? reMap(red, 0, 255f, 0, 1f) : reMap(red+256, 0, 255f, 0f, 1f),
                         (green > 0) ? reMap(green, 0, 255f, 0, 1f) : reMap(green+256, 0, 255f, 0f, 1f),
                         (blue > 0) ? reMap(blue, 0, 255f, 0, 1f) : reMap(blue+256, 0, 255f, 0f, 1f) );
}
 
開發者ID:Piratkopia13,項目名稱:Pixel-Planet,代碼行數:10,代碼來源:Util.java

示例5: convertImage

import org.newdawn.slick.opengl.Texture; //導入方法依賴的package包/類
private Image convertImage(String path) throws IOException {
    BufferedImage bufferedImage = ImageIO.read(DuskMoon.class.getResourceAsStream("/"+path));
    Texture texture = BufferedImageUtil.getTexture("", bufferedImage);
    Image image = null;
    try {
        image = new Image(texture.getImageWidth(), texture.getImageHeight());
        image.setTexture(texture);
    } catch (SlickException e) {
        e.printStackTrace();
    }

    return image;
}
 
開發者ID:Korriban,項目名稱:DuskMoon,代碼行數:14,代碼來源:Art.java


注:本文中的org.newdawn.slick.opengl.Texture.getImageWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。