本文整理汇总了Java中org.andengine.opengl.texture.region.ITiledTextureRegion.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java ITiledTextureRegion.getHeight方法的具体用法?Java ITiledTextureRegion.getHeight怎么用?Java ITiledTextureRegion.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.opengl.texture.region.ITiledTextureRegion
的用法示例。
在下文中一共展示了ITiledTextureRegion.getHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Base
import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入方法依赖的package包/类
Base(float pX, float pY, Type pType, boolean cpl, boolean touchable, AbstractGameActivity activity) {
super(pX, pY, touchable, SCALE_DEFAULT, activity.getTexture(chooseTextureName(pType, cpl)), activity.getVBOM());
final ITiledTextureRegion texture = activity.getTexture(cpl ? ResMan.PIANO_L_PHO_CPL : ResMan.PIANO_L_PHO);
final float phosphateX = pX - 0.45f * sprite.getWidth() * SCALE_DEFAULT;
final float phosphateY;
if (cpl) {
phosphateY = pY - 0.1f * texture.getHeight() * SCALE_DEFAULT;
} else {
phosphateY = pY + sprite.getHeight() * SCALE_DEFAULT;
}
phosphate = new Sprite(phosphateX, phosphateY, texture, activity.getVBOM());
type = pType;
setScale(SCALE_DEFAULT);
}
示例2: createItem
import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入方法依赖的package包/类
private void createItem(final Item.Type type, final Item.Role role) {
final ITiledTextureRegion texture;
final float angleD;
switch (type) {
case VITAMIN:
angleD = -45 + CalcUtils.randomOf(90, random);
texture = activity.getTexture(ResMan.GUT_VITAMIN);
break;
case PROTEIN:
angleD = CalcUtils.randomOf(360, random);
texture = activity.getTexture(ResMan.GUT_PROTEIN);
break;
case IMMUNO:
angleD = 90;
texture = activity.getTexture(ResMan.GUT_PHAGE);
break;
case ANTIBIO:
angleD = CalcUtils.randomOf(360, random);
texture = activity.getTexture(ResMan.GUT_ANTIBIO);
break;
default:
throw new IllegalStateException("No default!");
}
final float lanePos = POS_FLOW[getRandomLane()] + 5;
final float laneHeight = POS_FLOW[1] - POS_FLOW[0];
final float textureHeight = Item.SCALE_DEFAULT * (type == Item.Type.IMMUNO ? texture.getWidth() : texture.getHeight());
final float itemY = lanePos + (laneHeight - textureHeight) / 2;
final float speedCoeff = (float) ((50.0 + gameScore) / 50);
final Item item = new Item(POS_ITEM_X, itemY, (float) Math.toRadians(angleD), type, role, speedCoeff, texture, this);
activity.markForAddition(item);
}
示例3: TiledSprite
import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入方法依赖的package包/类
public TiledSprite(final float pX, final float pY, final ITiledTextureRegion pTiledTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager, final DrawType pDrawType) {
this(pX, pY, pTiledTextureRegion.getWidth(), pTiledTextureRegion.getHeight(), pTiledTextureRegion, pVertexBufferObjectManager, pDrawType);
}
示例4: getIdealScale
import org.andengine.opengl.texture.region.ITiledTextureRegion; //导入方法依赖的package包/类
protected static float getIdealScale(float scale, ITiledTextureRegion textureRegion) {
if (textureRegion.getHeight() + textureRegion.getWidth() <= 256) {
return scale * 4;
}
return scale;
}