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


Java VertexBufferObjectManager类代码示例

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


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

示例1: SplashScene

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public SplashScene(TextureManager textureManager, AssetManager assetManager, VertexBufferObjectManager vbo, Camera camera) {
    super();
    this.setBackground(new Background(new Color(100, 100, 100)));
    try {
        splashTexture = new AssetBitmapTexture(textureManager, assetManager, "textures/splash.png", TextureOptions.BILINEAR);
        splashTextureRegion = TextureRegionFactory.extractFromTexture(splashTexture);
        splashTexture.load();
        splash = new Sprite(0, 0, splashTextureRegion, vbo);

        final float scale_factor = GameActivity.CAMERA_HEIGHT / splashTextureRegion.getHeight();
        splash.setScale(scale_factor+0.1f);
        splash.setPosition((camera.getWidth()) * 0.5f, (camera.getHeight()) * 0.5f);
        this.attachChild(splash);
    } catch (final IOException e) {
        System.err.println("Error loading splash!");
        e.printStackTrace(System.err);
    }
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:19,代码来源:SplashScene.java

示例2: Dialog

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public Dialog(final float pWidth, final float pHeight, Buttons buttons, VertexBufferObjectManager vbo, final DialogListener listener) {
super(GameActivity.CAMERA_WIDTH / 2, GameActivity.CAMERA_HEIGHT / 2, pWidth, pHeight);
this.listener = listener;

Rectangle background = new BorderRectangle(pWidth/2, pHeight/2, pWidth, pHeight, vbo);
background.setColor(new Color(0.95f, 0.95f, 0.95f));
this.attachChild(background);

this.touchAreas = new ArrayList<ITouchArea>();

final Dialog that = this;
if (buttons == Buttons.OK) {
    Button okButton = new Button(pWidth / 2, 32, 192, 48, "Ok", vbo, new Button.OnClickListener() {
        @Override
        public void onClicked(Button button) {
            listener.onDialogButtonClicked(that, DialogButton.OK);
        }
    });
    this.attachChild(okButton);
    this.touchAreas.add(okButton);
} else if (buttons == Buttons.OK_CANCEL) {
    Button okButton = new Button(pWidth / 2 - 82, 32, 160, 48, "Ok", vbo, new Button.OnClickListener() {
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:23,代码来源:Dialog.java

示例3: AbstractSkillComponent

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的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

示例4: TMXParser

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public TMXParser(final AssetManager pAssetManager, final TextureManager pTextureManager, final TextureOptions pTextureOptions, final VertexBufferObjectManager pVertexBufferObjectManager, final ITMXTilePropertiesListener pTMXTilePropertyListener, TMXTileSetSourceManager pTMXTileSetSourceManager, boolean pUseLowMemoryVBO, boolean pAllocateTiles) {
	this.mAssetManager = pAssetManager;
	this.mTextureManager = pTextureManager;
	this.mTextureOptions = pTextureOptions;
	this.mVertexBufferObjectManager = pVertexBufferObjectManager;
	this.mTMXTilePropertyListener = pTMXTilePropertyListener;
	this.mTMXTileSetSourceManager = pTMXTileSetSourceManager;
	this.mUseLowMemoryVBO = pUseLowMemoryVBO;
	this.mAllocateTiles = pAllocateTiles;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:11,代码来源:TMXParser.java

示例5: TMXLoader

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
@Deprecated
public TMXLoader(final Context pContext, final TextureManager pTextureManager,
		final TextureOptions pTextureOptions, final VertexBufferObjectManager pVertexBufferObjectManager,
		final ITMXTilePropertiesListener pTMXTilePropertyListener) {
	this(pContext.getAssets(), pTextureManager, pTextureOptions, pVertexBufferObjectManager,
			pTMXTilePropertyListener, null);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:8,代码来源:TMXLoader.java

示例6: WordSprite

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
/**
 * Construct a new LetterSprite
 * @param pX the X coordinate of the scene to place this LetterSprite
 * @param pY the Y coordinate of the scene to place this LetterSprite
 * @param word the locale Word this sprite will represent
 * @param count how many you have
 * @param needed how many you need
 * @param region the ITextureRegion containing the tiles for this letter
 * @param vbo the game's VertexBufferObjectManager
 */
public WordSprite(float pX, float pY, Word word, int count, int needed, ITiledTextureRegion region, VertexBufferObjectManager vbo) {
    super(pX, pY, region, vbo);
    this.word = word;
    this.count = count;
    this.needed = needed;

    this.count_text = new Text(32, -10, GameFonts.inventoryCount(), "", 8, new TextOptions(HorizontalAlign.CENTER), vbo);
    this.setCount(count);
    this.attachChild(count_text);

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

示例7: Button

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public Button(float x, float y, float w, float h, String text, Color color, VertexBufferObjectManager pVertexBufferObjectManager, OnClickListener pOnClickListener) {
    super(x, y, w, h);
    this.clickDetector = new ClickDetector(this);
    this.clickListener = pOnClickListener;

    this.background = new Rectangle(this.getWidth()/2, this.getHeight()/2, w, h, pVertexBufferObjectManager);
    this.background.setColor(color);
    this.attachChild(this.background);

    final Font buttonFont = GameFonts.buttonText();
    this.buttonText = new Text(this.getWidth()/2, this.getHeight()/2, buttonFont, text, text.length(), new TextOptions(HorizontalAlign.CENTER), pVertexBufferObjectManager);
    this.attachChild(this.buttonText);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:14,代码来源:Button.java

示例8: MapBlockSprite

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
/**
 * Create a new PlacedBlockSprite.
 * @param pX the X coordinate of the scene to place this PlacedBlockSprite
 * @param pY the Y coordinate of the scene to place this PlacedBlockSprite
 * @param pTileId the index of first tile of the first animation set from pTiledTextureRegion
 * @param pTiledTextureRegion region containing the tile set for this PlacedBlockSprite
 * @param pVertexBufferObjectManager the game's VertexBufferObjectManager
 */
public MapBlockSprite(final PhoeniciaGame phoeniciaGame, final float pX, final float pY, final int pTileId, final ITiledTextureRegion pTiledTextureRegion, final VertexBufferObjectManager pVertexBufferObjectManager) {
    super(pX, pY, pTiledTextureRegion, pVertexBufferObjectManager);
    this.phoeniciaGame = phoeniciaGame;
    this.mTileId = pTileId;
    this.startTile = pTileId;
    this.setCurrentTileIndex(pTileId);

    this.clickDetector = new ClickDetector(this);
    this.holdDetector = new HoldDetector(this);
    this.holdDetector.setTriggerHoldMinimumMilliseconds(1000);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:20,代码来源:MapBlockSprite.java

示例9: BorderRectangle

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public BorderRectangle(float pX, float pY, float pWidth, float pHeight, VertexBufferObjectManager pVertexBufferObjectManager) {
    super(pX, pY, pWidth, pHeight, pVertexBufferObjectManager);
    this.border = new Rectangle(this.getWidth()/2, this.getHeight()/2, this.getWidth()+4, this.getHeight()+4, pVertexBufferObjectManager);
    this.border.setZIndex(this.getZIndex()-1);
    this.border.setColor(0.3f, 0.3f, 0.3f);
    this.attachChild(border);
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:8,代码来源:BorderRectangle.java

示例10: LetterSprite

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
/**
 * Construct a new LetterSprite
 * @param pX the X coordinate of the scene to place this LetterSprite
 * @param pY the Y coordinate of the scene to place this LetterSprite
 * @param letter the locale Letter this sprite will represent
 * @param count how many you have
 * @param needed how many you need
 * @param region the ITextureRegion containing the tiles for this letter
 * @param vbo the game's VertexBufferObjectManager
 */
public LetterSprite(float pX, float pY, Letter letter, int count, int needed, ITiledTextureRegion region, VertexBufferObjectManager vbo) {
    super(pX, pY, region, vbo);
    this.letter = letter;
    this.count = count;
    this.needed = needed;

    this.count_text = new Text(32, -10, GameFonts.inventoryCount(), "", 8, vbo);
    this.setCount(count);
    this.attachChild(count_text);

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

示例11: Bird

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public Bird(float birdXOffset, float birdYOffset, VertexBufferObjectManager mVertexBufferObjectManager, Scene mScene) {

		this.mBirdXOffset = birdXOffset;
		this.mBirdYOffset = birdYOffset;		
		
		mSprite = new AnimatedSprite(mBirdXOffset, mBirdYOffset, 55.8f, 40, mBirdTextureRegion, mVertexBufferObjectManager);
		mSprite.setColor(Color.YELLOW);
		mSprite.animate(115);
		mSprite.setZIndex(2);
		mScene.attachChild(mSprite);
		
	}
 
开发者ID:sunnyshah2894,项目名称:Flappy-Guy,代码行数:13,代码来源:Bird.java

示例12: createSprite

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
private static Sprite createSprite(final float pCameraWidth, final float pCameraHeight, final ITextureRegion pTextureRegion, final float pScale, final VertexBufferObjectManager pVertexBufferObjectManager) throws IllegalArgumentException {
	final int width = Math.round(pCameraWidth / pScale);
	final int height = Math.round(pCameraHeight / pScale);

	pTextureRegion.setTextureSize(width, height);

	return new Sprite(pCameraWidth * 0.5f, pCameraHeight * 0.5f, width * pScale, height * pScale, pTextureRegion, pVertexBufferObjectManager);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:RepeatingSpriteBackground.java

示例13: SlowRound

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public SlowRound(Enemy target, float x, float y, VertexBufferObjectManager pVertexBufferObjectManager) {
	
	// superconstructor
	super(x, y, TEXTURE, pVertexBufferObjectManager);
	
	// set variables
	mTarget = target;
	mSpeed = SPEED;
	mDamage = DAMAGE;
	mEffect = EFFECT;
	
}
 
开发者ID:tamzi,项目名称:sophia,代码行数:13,代码来源:Round.java

示例14: Level1Scene

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public Level1Scene(TowerDefense game, VertexBufferObjectManager pVertexBufferObjectManager) {
	
	// set game variables
	this.mGame = game;
	this.mCoins = STARTING_COINS;
	this.mHealth = STARTING_HEALTH;
	this.mAvailableTowers.add(Tower.TOWER_TEST);
	this.mAvailableTowers.add(Tower.TOWER_SLOW);
	this.mAvailableTowers.add(Tower.TOWER_FIRE);
	this.mAvailableTowers.add(Tower.TOWER_BOMB);
	this.mVertexBufferObjectManager = pVertexBufferObjectManager;
	this.mWaveDelay = WAVE_DELAY;
	
}
 
开发者ID:tamzi,项目名称:sophia,代码行数:15,代码来源:LevelScene.java

示例15: FireBallRound

import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public FireBallRound(Enemy target, float x, float y, VertexBufferObjectManager pVertexBufferObjectManager) {
	
	// superconstructor
	super(x, y, TEXTURE, pVertexBufferObjectManager);
	
	// set variables
	mTarget = target;
	mSpeed = SPEED;
	mDamage = DAMAGE;
	setScale(0.5f);
	
}
 
开发者ID:tamzi,项目名称:sophia,代码行数:13,代码来源:Round.java


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