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


Java Rectangle.getY方法代码示例

本文整理汇总了Java中org.andengine.entity.primitive.Rectangle.getY方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.getY方法的具体用法?Java Rectangle.getY怎么用?Java Rectangle.getY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.andengine.entity.primitive.Rectangle的用法示例。


在下文中一共展示了Rectangle.getY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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.getY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。