本文整理汇总了Java中org.andengine.entity.sprite.Sprite.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Sprite.getHeight方法的具体用法?Java Sprite.getHeight怎么用?Java Sprite.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.entity.sprite.Sprite
的用法示例。
在下文中一共展示了Sprite.getHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final FloatBuffer bufferData = this.mFloatBuffer;
final float width = pSprite.getWidth(); // TODO Optimize with field access?
final float height = pSprite.getHeight(); // TODO Optimize with field access?
bufferData.put(0 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X, 0);
bufferData.put(0 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y, 0);
bufferData.put(1 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X, 0);
bufferData.put(1 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y, height);
bufferData.put(2 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X, width);
bufferData.put(2 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y, 0);
bufferData.put(3 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X, width);
bufferData.put(3 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y, height);
this.setDirtyOnHardware();
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:22,代码来源:LowMemoryUniformColorSpriteVertexBufferObject.java
示例2: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final float[] bufferData = this.mBufferData;
final float width = pSprite.getWidth(); // TODO Optimize with field access?
final float height = pSprite.getHeight(); // TODO Optimize with field access?
bufferData[0 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X] = 0;
bufferData[0 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y] = 0;
bufferData[1 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X] = 0;
bufferData[1 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y] = height;
bufferData[2 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X] = width;
bufferData[2 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y] = 0;
bufferData[3 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X] = width;
bufferData[3 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y] = height;
this.setDirtyOnHardware();
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:22,代码来源:HighPerformanceUniformColorSpriteVertexBufferObject.java
示例3: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final float[] bufferData = this.mBufferData;
final float width = pSprite.getWidth(); // TODO Optimize with field access?
final float height = pSprite.getHeight(); // TODO Optimize with field access?
bufferData[0 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X] = 0;
bufferData[0 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y] = 0;
bufferData[1 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X] = 0;
bufferData[1 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y] = height;
bufferData[2 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X] = width;
bufferData[2 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y] = 0;
bufferData[3 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X] = width;
bufferData[3 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y] = height;
this.setDirtyOnHardware();
}
示例4: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final FloatBuffer bufferData = this.mFloatBuffer;
final float width = pSprite.getWidth(); // TODO Optimize with field access?
final float height = pSprite.getHeight(); // TODO Optimize with field access?
bufferData.put(0 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X, 0);
bufferData.put(0 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y, 0);
bufferData.put(1 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X, 0);
bufferData.put(1 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y, height);
bufferData.put(2 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X, width);
bufferData.put(2 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y, 0);
bufferData.put(3 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X, width);
bufferData.put(3 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y, height);
this.setDirtyOnHardware();
}
示例5: AbstractSkillComponent
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
/**
* Constructor.
* @param sprite the animation sprite
* @param cooldown the cooldown of the attack
*/
public AbstractSkillComponent(Sprite sprite, Sprite frame, float cooldown, VertexBufferObjectManager vb) {
this.iconSprite = sprite;
this.iconSprite.setZIndex(10);
this.iconFrame = frame;
this.iconFrame.setZIndex(12);
this.cooldown = cooldown;
this.ready = true;
Rectangle cooldownRect = new Rectangle(sprite.getX() + 3, sprite.getY() + 3, sprite.getWidth() -6 , sprite.getHeight() - 6, vb);
cooldownRect.setColor(0, 0, 0, 0.5f);
this.cooldownRectangle = cooldownRect;
this.cooldownRectangle.setZIndex(11);
this.cooldownRectangle.setVisible(false);
this.cooldownRectangeMaxHeight = cooldownRect.getHeight();
}
示例6: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final float[] bufferData = this.mBufferData;
final float width = pSprite.getWidth(); // TODO Optimize with field access?
final float height = pSprite.getHeight(); // TODO Optimize with field access?
final float halfWidth = width * 0.5f;
final float halfHeight = height * 0.5f;
bufferData[0 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X] = halfWidth;
bufferData[0 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y] = 0;
bufferData[1 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X] = 0;
bufferData[1 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y] = halfHeight;
bufferData[2 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X] = width;
bufferData[2 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y] = halfHeight;
bufferData[3 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X] = halfWidth;
bufferData[3 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y] = height;
this.setDirtyOnHardware();
}
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:25,代码来源:HighPerformanceDiamondSpriteVertexBufferObject.java
示例7: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final FloatBuffer bufferData = this.mFloatBuffer;
final float width = pSprite.getWidth(); // TODO Optimize with field access?
final float height = pSprite.getHeight(); // TODO Optimize with field access?
final float halfWidth = width * 0.5f;
final float halfHeight = height * 0.5f;
bufferData.put(0 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X, halfWidth);
bufferData.put(0 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y, 0);
bufferData.put(1 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X, 0);
bufferData.put(1 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y, halfHeight);
bufferData.put(2 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X, width);
bufferData.put(2 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y, halfHeight);
bufferData.put(3 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X, halfWidth);
bufferData.put(3 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y, height);
this.setDirtyOnHardware();
}
示例8: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final FloatBuffer bufferData = this.mFloatBuffer;
final float x = 0;
final float y = 0;
final float x2 = pSprite.getWidth(); // TODO Optimize with field access?
final float y2 = pSprite.getHeight(); // TODO Optimize with field access?
final float xCenter = (x + x2) * 0.5f;
final float yCenter = (y + y2) * 0.5f;
bufferData.put(0 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X, x);
bufferData.put(0 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y, yCenter);
bufferData.put(1 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X, xCenter);
bufferData.put(1 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y, y2);
bufferData.put(2 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X, xCenter);
bufferData.put(2 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y, y);
bufferData.put(3 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_X, x2);
bufferData.put(3 * Sprite.VERTEX_SIZE + Sprite.VERTEX_INDEX_Y, yCenter);
this.setDirtyOnHardware();
}
示例9: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final float[] bufferData = this.mBufferData;
final float x = 0;
final float y = 0;
final float x2 = pSprite.getWidth(); // TODO Optimize with field access?
final float y2 = pSprite.getHeight(); // TODO Optimize with field access?
bufferData[0 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X] = x;
bufferData[0 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y] = y;
bufferData[1 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X] = x;
bufferData[1 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y] = y2;
bufferData[2 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X] = x2;
bufferData[2 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y] = y;
bufferData[3 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X] = x2;
bufferData[3 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y] = y2;
this.setDirtyOnHardware();
}
示例10: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final float[] bufferData = this.mBufferData;
final float x = 0;
final float y = 0;
final float x2 = pSprite.getWidth(); // TODO Optimize with field access?
final float y2 = pSprite.getHeight(); // TODO Optimize with field access?
bufferData[0 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X] = x;
bufferData[0 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y] = y;
bufferData[1 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X] = x;
bufferData[1 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y] = y2;
bufferData[2 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X] = x2;
bufferData[2 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y] = y;
bufferData[3 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_X] = x2;
bufferData[3 * UniformColorSprite.VERTEX_SIZE + UniformColorSprite.VERTEX_INDEX_Y] = y2;
this.setDirtyOnHardware();
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:24,代码来源:HighPerformanceUniformColorSpriteVertexBufferObject.java
示例11: onUpdateVertices
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Sprite pSprite) {
final float[] bufferData = this.mBufferData;
final float width = pSprite.getWidth(); // TODO Optimize with field access?
final float height = pSprite.getHeight(); // TODO Optimize with field access?
bufferData[0 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X] = 0;
bufferData[0 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y] = 0;
bufferData[1 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X] = 0;
bufferData[1 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y] = height;
bufferData[2 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X] = width;
bufferData[2 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y] = 0;
bufferData[3 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_X] = width;
bufferData[3 * UncoloredSprite.VERTEX_SIZE + UncoloredSprite.VERTEX_INDEX_Y] = height;
this.setDirtyOnHardware();
}
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:22,代码来源:HighPerformanceUncoloredSpriteVertexBufferObject.java
示例12: updateControlKnob
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
private void updateControlKnob(final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
final Sprite controlBase = this.mControlBase;
final float relativeX = (MathUtils.bringToBounds(0, controlBase.getWidth(), pTouchAreaLocalX) / controlBase.getWidth()) - 0.5f;
final float relativeY = (MathUtils.bringToBounds(0, controlBase.getHeight(), pTouchAreaLocalY) / controlBase.getHeight()) - 0.5f;
this.onUpdateControlKnob(relativeX, relativeY);
}
示例13: updateControlKnob
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
private void updateControlKnob(final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
final Sprite controlBase = this.mControlBase;
final float relativeX = MathUtils.bringToBounds(0, controlBase.getWidth(), pTouchAreaLocalX) / controlBase.getWidth() - 0.5f;
final float relativeY = MathUtils.bringToBounds(0, controlBase.getHeight(), pTouchAreaLocalY) / controlBase.getHeight() - 0.5f;
this.onUpdateControlKnob(relativeX, relativeY);
}
示例14: onUpdateControlKnob
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
/**
* @param pRelativeX from <code>-0.5</code> (left) to <code>0.5</code> (right).
* @param pRelativeY from <code>-0.5</code> (top) to <code>0.5</code> (bottom).
*/
protected void onUpdateControlKnob(final float pRelativeX, final float pRelativeY) {
final Sprite controlBase = this.mControlBase;
final Sprite controlKnob = this.mControlKnob;
this.mControlValueX = 2 * pRelativeX;
this.mControlValueY = 2 * pRelativeY;
final float[] controlBaseSceneCenterCoordinates = controlBase.getSceneCenterCoordinates();
final float x = controlBaseSceneCenterCoordinates[VERTEX_INDEX_X] - controlKnob.getWidth() * 0.5f + pRelativeX * controlBase.getWidthScaled();
final float y = controlBaseSceneCenterCoordinates[VERTEX_INDEX_Y] - controlKnob.getHeight() * 0.5f + pRelativeY * controlBase.getHeightScaled();
controlKnob.setPosition(x, y);
}
示例15: onUpdateControlKnob
import org.andengine.entity.sprite.Sprite; //导入方法依赖的package包/类
/**
* @param pRelativeX from <code>-0.5f</code> (left) to <code>0.5</code> (right).
* @param pRelativeY from <code>-0.5f</code> (bottom) to <code>0.5f</code> (top).
*/
protected void onUpdateControlKnob(final float pRelativeX, final float pRelativeY) {
final Sprite controlBase = this.mControlBase;
final Sprite controlKnob = this.mControlKnob;
this.mControlValueX = 2 * pRelativeX;
this.mControlValueY = 2 * pRelativeY;
final float x = controlBase.getWidth() * (0.5f + pRelativeX);
final float y = controlBase.getHeight() * (0.5f + pRelativeY);
controlKnob.setPosition(x, y);
}