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


Java IMenuItem.setPosition方法代码示例

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


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

示例1: prepareAnimations

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
public void prepareAnimations(final ArrayList<IMenuItem> pMenuItems, final float pCameraWidth, final float pCameraHeight) {
	final float maximumWidth = this.getMaximumWidth(pMenuItems);
	final float overallHeight = this.getOverallHeight(pMenuItems);

	final float baseY = (pCameraHeight - overallHeight) * 0.5f;

	final float menuItemSpacing = this.mMenuItemSpacing;

	float offsetY = 0;
	final int menuItemCount = pMenuItems.size();
	for(int i = 0; i < menuItemCount; i++) {
		final IMenuItem menuItem = pMenuItems.get(i);

		menuItem.setPosition(-maximumWidth, baseY + offsetY);

		offsetY += menuItem.getHeight() + menuItemSpacing;
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:20,代码来源:SlideMenuAnimator.java

示例2: onMenuItemPositionReset

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
protected void onMenuItemPositionReset(final MenuScene pMenuScene, final int pIndex, final IMenuItem pMenuItem, final float pX, final float pY) {
	pMenuItem.setPosition(pX, pY);

	pMenuItem.resetEntityModifiers();
	pMenuItem.setAlpha(AlphaMenuSceneAnimator.ALPHA_FROM);
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:8,代码来源:AlphaMenuSceneAnimator.java

示例3: onMenuItemPositionReset

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
protected void onMenuItemPositionReset(final MenuScene pMenuScene, final int pIndex, final IMenuItem pMenuItem, final float pX, final float pY) {
	final float fromX = getFromX(pMenuScene, pMenuItem, pX);
	final float fromY = getFromY(pMenuScene, pMenuItem, pY);

	pMenuItem.setPosition(fromX, fromY);

	pMenuItem.resetEntityModifiers();
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:10,代码来源:SlideMenuSceneAnimator.java

示例4: onMenuItemPositionBuilt

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
protected void onMenuItemPositionBuilt(final MenuScene pMenuScene, final int pIndex, final IMenuItem pMenuItem, final float pX, final float pY) {
	pMenuItem.setPosition(pX, pY);

	final AlphaModifier alphaModifier = new AlphaModifier(AlphaMenuSceneAnimator.DURATION, AlphaMenuSceneAnimator.ALPHA_FROM, AlphaMenuSceneAnimator.ALPHA_TO, this.mEaseFunction);
	alphaModifier.setAutoUnregisterWhenFinished(false);
	pMenuItem.registerEntityModifier(alphaModifier);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:AlphaMenuSceneAnimator.java

示例5: onMenuItemPositionBuilt

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
protected void onMenuItemPositionBuilt(final MenuScene pMenuScene, final int pIndex, final IMenuItem pMenuItem, final float pX, final float pY) {
	final float fromX = getFromX(pMenuScene, pMenuItem, pX);
	final float fromY = getFromY(pMenuScene, pMenuItem, pY);

	pMenuItem.setPosition(fromX, fromY);

	final MoveModifier moveModifier = new MoveModifier(SlideMenuSceneAnimator.DURATION, fromX, fromY, pX, pY, this.mEaseFunction);
	moveModifier.setAutoUnregisterWhenFinished(false);
	pMenuItem.registerEntityModifier(moveModifier);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:SlideMenuSceneAnimator.java

示例6: prepareAnimations

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
public void prepareAnimations(final ArrayList<IMenuItem> pMenuItems, final float pCameraWidth, final float pCameraHeight) {
	final float maximumWidth = this.getMaximumWidth(pMenuItems);
	final float overallHeight = this.getOverallHeight(pMenuItems);

	final float baseX = (pCameraWidth - maximumWidth) * 0.5f;
	final float baseY = (pCameraHeight - overallHeight) * 0.5f;

	final float menuItemSpacing = this.mMenuItemSpacing;

	float offsetY = 0;
	final int menuItemCount = pMenuItems.size();
	for(int i = 0; i < menuItemCount; i++) {
		final IMenuItem menuItem = pMenuItems.get(i);

		final float offsetX;
		switch(this.mHorizontalAlign) {
			case LEFT:
				offsetX = 0;
				break;
			case RIGHT:
				offsetX = maximumWidth - menuItem.getWidthScaled();
				break;
			case CENTER:
			default:
				offsetX = (maximumWidth - menuItem.getWidthScaled()) * 0.5f;
				break;
		}
		menuItem.setPosition(baseX + offsetX , baseY + offsetY);

		offsetY += menuItem.getHeight() + menuItemSpacing;
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:34,代码来源:DirectMenuAnimator.java

示例7: prepareAnimations

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
public void prepareAnimations(final ArrayList<IMenuItem> pMenuItems, final float pCameraWidth, final float pCameraHeight) {
	final float maximumWidth = this.getMaximumWidth(pMenuItems);
	final float overallHeight = this.getOverallHeight(pMenuItems);

	final float baseX = (pCameraWidth - maximumWidth) * 0.5f;
	final float baseY = (pCameraHeight - overallHeight) * 0.5f;

	final float menuItemSpacing = this.mMenuItemSpacing;

	float offsetY = 0;
	final int menuItemCount = pMenuItems.size();
	for(int i = 0; i < menuItemCount; i++) {
		final IMenuItem menuItem = pMenuItems.get(i);

		final float offsetX;
		switch(this.mHorizontalAlign) {
			case LEFT:
				offsetX = 0;
				break;
			case RIGHT:
				offsetX = maximumWidth - menuItem.getWidthScaled();
				break;
			case CENTER:
			default:
				offsetX = (maximumWidth - menuItem.getWidthScaled()) * 0.5f;
				break;
		}
		menuItem.setPosition(baseX + offsetX , baseY + offsetY);

		menuItem.setAlpha(ALPHA_FROM);

		offsetY += menuItem.getHeight() + menuItemSpacing;
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:36,代码来源:AlphaMenuAnimator.java

示例8: onMenuItemPositionBuilt

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
protected void onMenuItemPositionBuilt(final MenuScene pMenuScene, final int pIndex, final IMenuItem pMenuItem, final float pX, final float pY) {
	pMenuItem.setPosition(pX, pY);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:5,代码来源:InstantMenuSceneAnimator.java

示例9: onMenuItemPositionReset

import org.andengine.entity.scene.menu.item.IMenuItem; //导入方法依赖的package包/类
@Override
protected void onMenuItemPositionReset(final MenuScene pMenuScene, final int pIndex, final IMenuItem pMenuItem, final float pX, final float pY) {
	pMenuItem.setPosition(pX, pY);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:5,代码来源:InstantMenuSceneAnimator.java


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