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


Java Rectangle.getHeight方法代码示例

本文整理汇总了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();
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:22,代码来源:HighPerformanceRectangleVertexBufferObject.java

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

示例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();
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:24,代码来源:HighPerformanceRectangleVertexBufferObject.java

示例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();
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:24,代码来源:LowMemoryRectangleVertexBufferObject.java

示例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();
}
 
开发者ID:Callilf,项目名称:RotatingSentries,代码行数:21,代码来源:AbstractSkillComponent.java

示例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);
        }
    }
 
开发者ID:djschilling,项目名称:sopa,代码行数:20,代码来源:JustPlayLostScene.java

示例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));
}
 
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:21,代码来源:SRPGPart.java

示例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++;

}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:10,代码来源:SendGiftHUD.java

示例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++;

}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:10,代码来源:RequestGiftHUD.java

示例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);
}
 
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:69,代码来源:ExpDistributionLayer.java


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