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


Java HUD类代码示例

本文整理汇总了Java中org.andengine.engine.camera.hud.HUD的典型用法代码示例。如果您正苦于以下问题:Java HUD类的具体用法?Java HUD怎么用?Java HUD使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HUD类属于org.andengine.engine.camera.hud包,在下文中一共展示了HUD类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createText

import org.andengine.engine.camera.hud.HUD; //导入依赖的package包/类
private void createText() {
	HUD hud = new HUD();
	res.camera.setHUD(hud);
	infoText = new Text(Constants.CW / 2 , Constants.CH / 2 - 200, res.font, "12345678901234567890", vbom);
	hud.attachChild(infoText);
	
	scoreText = new Text(Constants.CW / 2 , Constants.CH / 2 + 200, res.font, "12345678901234567890", vbom);
	hud.attachChild(scoreText);
	
	Sprite banner = new Sprite(0, Constants.CH, res.bannerRegion, vbom) {

		@Override
		public boolean onAreaTouched(TouchEvent pSceneTouchEvent,
				float pTouchAreaLocalX, float pTouchAreaLocalY) {
			if (pSceneTouchEvent.isActionDown()) {
				res.activity.gotoPlayStore();
			}
			return true;
		}
		
	};
	banner.setAnchorCenter(0, 1);
	hud.registerTouchArea(banner);
	hud.attachChild(banner);
	
}
 
开发者ID:sm4,项目名称:FlyingDandelion,代码行数:27,代码来源:GameScene.java

示例2: createHUD

import org.andengine.engine.camera.hud.HUD; //导入依赖的package包/类
private void createHUD() {
	mHUD = new HUD(); // create fixed HUD for static text display
	
	mTimeText = new Text(0, 0, mResourcesManager.mFontSmall, Phrases.getPossibleCharacters(Phrases.FIELD_TIME), new TextOptions(HorizontalAlign.LEFT), mVertexManager); // prepare memory with all possible chars
	mExclamation = new Text(0, 0, mResourcesManager.mFontBig, Phrases.getPossibleCharacters(Phrases.FIELD_EXCLAMATION), new TextOptions(HorizontalAlign.CENTER), mVertexManager); // prepare memory with all possible chars
	mScoreText = new Text(0, 0, mResourcesManager.mFontSmall, Phrases.getPossibleCharacters(Phrases.FIELD_SCORE), new TextOptions(HorizontalAlign.RIGHT), mVertexManager); // prepare memory with all possible chars
	mBottomText = new Text(0, 0, mResourcesManager.mFontSmall, Phrases.getPossibleCharacters(Phrases.FIELD_TAP_TO_LEAVE), new TextOptions(HorizontalAlign.CENTER), mVertexManager); // prepare memory with all possible chars
	updateScore();
	updateExclamation();
	updateText(mBottomText, Phrases.mEmpty, GameScreen.CAMERA_WIDTH/2, GameScreen.CAMERA_HEIGHT/3, TEXT_HALIGN_CENTER, TEXT_VALIGN_TOP);
	
	mHUD.attachChild(mTimeText);
	mHUD.attachChild(mExclamation);
	mHUD.attachChild(mScoreText);
	mHUD.attachChild(mBottomText);

	mCamera.setHUD(mHUD);
}
 
开发者ID:delight-im,项目名称:NationSoccer,代码行数:19,代码来源:GameScene.java

示例3: onAttached

import org.andengine.engine.camera.hud.HUD; //导入依赖的package包/类
/**
 * Because clipping uses different coordinate transformation depending on whether the Scrollable
 * is in a normal Scene or a HUD, we have to check where this Scrollable is being attached and
 * set the isInHUD member appropriately.
 */
@Override
public void onAttached() {
    IEntity node = this;
    while (node.hasParent()) {
        node = node.getParent();
        if (node instanceof HUD || node instanceof CameraScene) {
            this.isInHUD = true;
            return;
        }
    }

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

示例4: createIntro

import org.andengine.engine.camera.hud.HUD; //导入依赖的package包/类
private void createIntro() {
	mIntro = new HUD(); // create fixed HUD for tutorial display
	
	mIntro_Text = new Text(0, 0, mResourcesManager.mFontSmall, Phrases.getPossibleCharacters(Phrases.FIELD_TAP_TO_START), new TextOptions(HorizontalAlign.CENTER), mVertexManager); // prepare memory with all possible chars
	mIntro_Text.setColor(1.0f, 1.0f, 1.0f);
	updateText(mIntro_Text, Phrases.mTapToStart, GameScreen.CAMERA_WIDTH/2, GameScreen.CAMERA_HEIGHT/3, TEXT_HALIGN_CENTER, TEXT_VALIGN_TOP);
	mIntro.attachChild(mIntro_Text);
	
	mCamera.setHUD(mIntro);
	setOnSceneTouchListener(this);
}
 
开发者ID:delight-im,项目名称:NationSoccer,代码行数:12,代码来源:GameScene.java

示例5: getHUD

import org.andengine.engine.camera.hud.HUD; //导入依赖的package包/类
public HUD getHUD() {
	return this.mHUD;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:4,代码来源:Camera.java

示例6: setHUD

import org.andengine.engine.camera.hud.HUD; //导入依赖的package包/类
public void setHUD(final HUD pHUD) {
	this.mHUD = pHUD;
	if (pHUD != null) {
		pHUD.setCamera(this);
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:7,代码来源:Camera.java

示例7: setHUD

import org.andengine.engine.camera.hud.HUD; //导入依赖的package包/类
public void setHUD(final HUD pHUD) {
	this.mHUD = pHUD;
	if(pHUD != null) {
		pHUD.setCamera(this);
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:7,代码来源:Camera.java

示例8: showLayer

import org.andengine.engine.camera.hud.HUD; //导入依赖的package包/类
public void showLayer(final ManagedLayer pLayer, final boolean pSuspendSceneDrawing, final
        boolean pSuspendSceneUpdates, final boolean pSuspendSceneTouchEvents) {
    // If the camera already has a HUD, we will use it.
    if(mEngine.getCamera().hasHUD()){
        mCameraHadHud = true;
    } else {
        // Otherwise, we will create one to use.
        mCameraHadHud = false;
        HUD placeholderHud = new HUD();
        mEngine.getCamera().setHUD(placeholderHud);
    }
    // If the managed layer needs modal properties, set them.
    if(pSuspendSceneDrawing || pSuspendSceneUpdates || pSuspendSceneTouchEvents) {
        // Apply the managed layer directly to the Camera's HUD
        mEngine.getCamera().getHUD().setChildScene(pLayer, pSuspendSceneDrawing,
                pSuspendSceneUpdates, pSuspendSceneTouchEvents);
        // Create the place-holder scene if it needs to be created.
        if(mPlaceholderModalScene==null) {
            mPlaceholderModalScene = new Scene();
            mPlaceholderModalScene.setBackgroundEnabled(false);
        }
        // Apply the place-holder to the current scene.
        mCurrentScene.setChildScene(mPlaceholderModalScene, pSuspendSceneDrawing,
                pSuspendSceneUpdates, pSuspendSceneTouchEvents);
    } else {
        // If the managed layer does not need to be modal, simply set it to the HUD.
        mEngine.getCamera().getHUD().setChildScene(pLayer);
    }
    // Set the camera for the managed layer so that it binds to the camera if the camera is
    // moved/scaled/rotated.
    pLayer.setCamera(mEngine.getCamera());
    // Scale the layer according to screen size.
    pLayer.setScale(ResourceManager.getInstance().cameraScaleFactorX,
            ResourceManager.getInstance().cameraScaleFactorY);
    // Let the layer know that it is being shown.
    pLayer.onShowManagedLayer();
    // Reflect that a layer is shown.
    isLayerShown = true;
    // Set the current layer to pLayer.
    currentLayer = pLayer;
}
 
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:42,代码来源:SceneManager.java


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