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


Java ITiledTextureRegion.getHeight方法代码示例

本文整理汇总了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);
}
 
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:17,代码来源:Base.java

示例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);
}
 
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:33,代码来源:GutGame.java

示例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);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:4,代码来源:TiledSprite.java

示例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;
}
 
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:7,代码来源:WorldObject.java


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