本文整理汇总了Java中org.andengine.entity.primitive.Rectangle.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.getHeight方法的具体用法?Java Rectangle.getHeight怎么用?Java Rectangle.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.entity.primitive.Rectangle
的用法示例。
在下文中一共展示了Rectangle.getHeight方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdateVertices
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Rectangle pRectangle) {
final float[] bufferData = this.mBufferData;
final float width = pRectangle.getWidth(); // TODO Optimize with field access?
final float height = pRectangle.getHeight(); // TODO Optimize with field access?
bufferData[(0 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_X] = 0;
bufferData[(0 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_Y] = 0;
bufferData[(1 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_X] = 0;
bufferData[(1 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_Y] = height;
bufferData[(2 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_X] = width;
bufferData[(2 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_Y] = 0;
bufferData[(3 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_X] = width;
bufferData[(3 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_Y] = height;
this.setDirtyOnHardware();
}
示例2: onUpdateVertices
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Rectangle pRectangle) {
final FloatBuffer bufferData = this.mFloatBuffer;
final float width = pRectangle.getWidth(); // TODO Optimize with field access?
final float height = pRectangle.getHeight(); // TODO Optimize with field access?
bufferData.put((0 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_X, 0);
bufferData.put((0 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_Y, 0);
bufferData.put((1 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_X, 0);
bufferData.put((1 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_Y, height);
bufferData.put((2 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_X, width);
bufferData.put((2 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_Y, 0);
bufferData.put((3 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_X, width);
bufferData.put((3 * Rectangle.VERTEX_SIZE) + Rectangle.VERTEX_INDEX_Y, height);
this.setDirtyOnHardware();
}
示例3: onUpdateVertices
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Rectangle pRectangle) {
final float[] bufferData = this.mBufferData;
final float x = 0;
final float y = 0;
final float x2 = pRectangle.getWidth(); // TODO Optimize with field access?
final float y2 = pRectangle.getHeight(); // TODO Optimize with field access?
bufferData[0 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_X] = x;
bufferData[0 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_Y] = y;
bufferData[1 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_X] = x;
bufferData[1 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_Y] = y2;
bufferData[2 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_X] = x2;
bufferData[2 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_Y] = y;
bufferData[3 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_X] = x2;
bufferData[3 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_Y] = y2;
this.setDirtyOnHardware();
}
示例4: onUpdateVertices
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
@Override
public void onUpdateVertices(final Rectangle pRectangle) {
final FloatBuffer bufferData = this.mFloatBuffer;
final float x = 0;
final float y = 0;
final float x2 = pRectangle.getWidth();
final float y2 = pRectangle.getHeight();
bufferData.put(0 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_X, x);
bufferData.put(0 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_Y, y);
bufferData.put(1 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_X, x);
bufferData.put(1 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_Y, y2);
bufferData.put(2 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_X, x2);
bufferData.put(2 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_Y, y);
bufferData.put(3 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_X, x2);
bufferData.put(3 * Rectangle.VERTEX_SIZE + Rectangle.VERTEX_INDEX_Y, y2);
this.setDirtyOnHardware();
}
示例5: AbstractSkillComponent
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的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: addRectangles
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
private void addRectangles() {
Rectangle rectangleScore = new Rectangle(0, (float) (camera.getHeight() * 0.45), camera.getWidth(),
textFieldHeight, vbom);
rectangleScore.setColor(0, 102 / 255f, 255 / 255f);
attachChild(rectangleScore);
Rectangle rectangleLevel = new Rectangle(0, rectangleScore.getY() + textFieldHeight, camera.getWidth(),
rectangleScore.getHeight(), vbom);
rectangleLevel.setColor(YELLOW);
attachChild(rectangleLevel);
if (justPlayScoreService.getHighscore() != null) {
Rectangle rectangleHighscore = new Rectangle(0, rectangleLevel.getY() + textFieldHeight, camera.getWidth(),
textFieldHeight, vbom);
rectangleHighscore.setColor(153 / 255f, 102 / 255f, 0);
attachChild(rectangleHighscore);
}
}
示例7: mapMove
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
private void mapMove(PointF movePointF) {
Rectangle mapBaseRect = getBaseMap();
// 表示可能領域で補正
if (getStartDispX() > movePointF.x) {
movePointF.x = getStartDispX();
}
if (getEndDispX(mapBaseRect) < (movePointF.x + mapBaseRect.getWidth())) {
movePointF.x = getEndDispX(mapBaseRect) - mapBaseRect.getWidth();
}
if (getStartDispY() > movePointF.y) {
movePointF.y = getStartDispY();
}
if (getEndDispY(mapBaseRect) < (movePointF.y + mapBaseRect.getHeight())) {
movePointF.y = getEndDispY(mapBaseRect) - mapBaseRect.getHeight();
}
mapBaseRect.registerEntityModifier(new MoveModifier(0.2f,
mapBaseRect.getX(), movePointF.x,
mapBaseRect.getY(), movePointF.y));
}
示例8: inputNumber
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
public void inputNumber(Number n) {
if (inputCursor >= CODE_LENGTH) return;
requestCode += n.intval * (Math.pow(10, CODE_LENGTH-inputCursor-1));
Rectangle inputBox = inputLocations[inputCursor];
Sprite inputChar = new Sprite(inputBox.getWidth()/2, inputBox.getHeight()/2, game.numberSprites.get(n), PhoeniciaContext.vboManager);
inputBox.attachChild(inputChar);
inputCursor++;
}
示例9: inputNumber
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
public void inputNumber(Number n) {
if (inputCursor >= CODE_LENGTH) return;
responseCode += n.intval * (Math.pow(10, CODE_LENGTH-inputCursor-1));
Rectangle inputBox = inputLocations[inputCursor];
Sprite inputChar = new Sprite(inputBox.getWidth()/2, inputBox.getHeight()/2, game.numberSprites.get(n), PhoeniciaContext.vboManager);
inputBox.attachChild(inputChar);
inputCursor++;
}
示例10: init
import org.andengine.entity.primitive.Rectangle; //导入方法依赖的package包/类
private void init(KeyListenScene pBaseScene) {
// 共通ウィンドウを作成
CommonWindowRectangle comonWindowRectangle = new CommonWindowRectangle(
0,
0,
pBaseScene.getWindowWidth(),
pBaseScene.getWindowHeight(),
Color.BLACK, 0.8f,
pBaseScene);
attachChild(comonWindowRectangle);
// タイトル
float titleY = 12;
Font titleFont = pBaseScene.createFont(Typeface.DEFAULT_BOLD, 30, Color.WHITE);
Text titleText = new Text(10, 10, titleFont, "〜 経験値振り分け 〜",
pBaseScene.getBaseActivity().getVertexBufferObjectManager());
pBaseScene.placeToCenterX(titleText, titleY);
attachChild(titleText);
float titleLineY = titleText.getY() + titleText.getHeight() + 4;
Line line = new Line(10, titleLineY, pBaseScene.getWindowWidth() - 16, titleLineY,
pBaseScene.getBaseActivity().getVertexBufferObjectManager());
line.setLineWidth(1);
line.setColor(Color.WHITE);
line.setAlpha(1.0f);
attachChild(line);
TextLogic textLogic = new TextLogic();
Font defaultFont = pBaseScene.createFont(Typeface.SANS_SERIF, 16, Color.WHITE);
Font paramFont = pBaseScene.createFont(Typeface.DEFAULT, 16, Color.YELLOW);
//Font upParamFont = pBaseScene.createFont(Typeface.DEFAULT, 16, Color.BLUE);
// Expの表示
float expY = titleLineY + 4;
Rectangle totalExpTextRect = textLogic.createTextRectangle("所持経験値:", defaultFont, "100 Exp", paramFont,
pBaseScene.getBaseActivity().getVertexBufferObjectManager());
attachChild(totalExpTextRect);
Rectangle afterExpTextRect = textLogic.createTextRectangle("振り分け後経験値:", defaultFont, "0 Exp", paramFont,
pBaseScene.getBaseActivity().getVertexBufferObjectManager());
attachChild(afterExpTextRect);
totalExpTextRect.setPosition(pBaseScene.getWindowWidth() / 2 -
(totalExpTextRect.getX() + totalExpTextRect.getWidth() + 50 + afterExpTextRect.getWidth()) / 2, expY);
afterExpTextRect.setPosition(
totalExpTextRect.getX() + totalExpTextRect.getWidth() + 50,
totalExpTextRect.getY());
float expLineY = totalExpTextRect.getY() + totalExpTextRect.getHeight() + 4;
Line expLine = new Line(10, expLineY, pBaseScene.getWindowWidth() - 16, expLineY,
pBaseScene.getBaseActivity().getVertexBufferObjectManager());
expLine.setLineWidth(1);
expLine.setColor(Color.WHITE);
expLine.setAlpha(1.0f);
attachChild(expLine);
// プレイヤー情報
float playerX = 12;
float playerY = expLineY + 12;
ActorPlayerLogic actorPlayerLogic = new ActorPlayerLogic();
ActorPlayerDto actorPlayerDto = actorPlayerLogic.createActorPlayerDto(pBaseScene, 1);
PlayerStatusRectangle playerStatusRectangle = new PlayerStatusRectangle(pBaseScene, defaultFont,
actorPlayerDto, ActorSpriteUtil.getFaceFileName(actorPlayerDto.getImageResId()), playerX, playerY);
playerStatusRectangle.show(PlayerStatusRectangleType.MINI_STATUS);
attachChild(playerStatusRectangle);
}