org.andengine.engine.camera.hud.HUD Java Examples

The following examples show how to use org.andengine.engine.camera.hud.HUD. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LevelChoiceScene.java    From sopa with Apache License 2.0 5 votes vote down vote up
private void addChangeLevelButtons() {

        int screenCount = ((int) (levelInfos.size() - 0.1) / 12) + 1;
        rightArrow = new ButtonSprite(camera.getWidth() * 0.93f - LEVEL_SELECT_ICON_WIDTH, camera.getHeight() * 0.8f,
                resourcesManager.levelChoiceArrowRightRegion, vbom, new ButtonSprite.OnClickListener() {

                    @Override
                    public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) {

                        levelChoiceService.moveRight();
                    }
                });
        leftArrow = new ButtonSprite(camera.getWidth() * 0.07f, camera.getHeight() * 0.8f,
                resourcesManager.levelChoiceArrowLeftRegion, vbom, new ButtonSprite.OnClickListener() {

                    @Override
                    public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) {

                        levelChoiceService.moveLeft();
                    }
                });

        leftArrow.setVisible(false);

        if (screenCount == 1) {
            rightArrow.setVisible(false);
        }

        arrowHud = new HUD();
        arrowHud.attachChild(leftArrow);
        arrowHud.attachChild(rightArrow);
        arrowHud.registerTouchArea(leftArrow);
        arrowHud.registerTouchArea(rightArrow);
        camera.setHUD(arrowHud);
        entityToFollow = new Entity(camera.getWidth() / 2, camera.getHeight() / 2);
        attachChild(entityToFollow);
        camera.setChaseEntity(entityToFollow);
    }
 
Example #2
Source File: Camera.java    From tilt-game-android with MIT License 4 votes vote down vote up
public HUD getHUD() {
	return this.mHUD;
}
 
Example #3
Source File: Camera.java    From tilt-game-android with MIT License 4 votes vote down vote up
public void setHUD(final HUD pHUD) {
	this.mHUD = pHUD;
	if (pHUD != null) {
		pHUD.setCamera(this);
	}
}
 
Example #4
Source File: Camera.java    From 30-android-libraries-in-30-days with Apache License 2.0 4 votes vote down vote up
public HUD getHUD() {
	return this.mHUD;
}
 
Example #5
Source File: Camera.java    From 30-android-libraries-in-30-days with Apache License 2.0 4 votes vote down vote up
public void setHUD(final HUD pHUD) {
	this.mHUD = pHUD;
	if(pHUD != null) {
		pHUD.setCamera(this);
	}
}