本文整理匯總了Java中com.badlogic.gdx.graphics.Texture.getTextureData方法的典型用法代碼示例。如果您正苦於以下問題:Java Texture.getTextureData方法的具體用法?Java Texture.getTextureData怎麽用?Java Texture.getTextureData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.graphics.Texture
的用法示例。
在下文中一共展示了Texture.getTextureData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: stencil
import com.badlogic.gdx.graphics.Texture; //導入方法依賴的package包/類
private void stencil(Planet planet, Texture texture, PlanetCell.CellType[] replaceTypes, int degrees, int x1, int y1) {
final TextureData textureData = texture.getTextureData();
textureData.prepare();
final Pixmap pixmap = textureData.consumePixmap();
for (int y = 0; y < texture.getHeight(); y++) {
for (int x = 0; x < texture.getWidth(); x++) {
tv.set(x, y).rotate(degrees).add(x1, y1);
int color = pixmap.getPixel(x, texture.getHeight() - y);
final PlanetCell.CellType type = getSourceCellType(planet, color);
if (type != null) {
replaceCell(planet, Math.round(tv.x), Math.round(tv.y), replaceTypes, type, color);
}
}
}
pixmap.dispose();
}