本文整理汇总了Java中org.andengine.opengl.vbo.VertexBufferObjectManager类的典型用法代码示例。如果您正苦于以下问题:Java VertexBufferObjectManager类的具体用法?Java VertexBufferObjectManager怎么用?Java VertexBufferObjectManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VertexBufferObjectManager类属于org.andengine.opengl.vbo包,在下文中一共展示了VertexBufferObjectManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Bin
import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public Bin(Type binType, float pX, float pY, ITiledTextureRegion pTextureRegion,
VertexBufferObjectManager pVertexBufferObject, PhysicsWorld physicsWorld) {
super(new PhysicalWorldObject.Builder(pX, pY, pTextureRegion, pVertexBufferObject, physicsWorld)
.angle(0).draggable(false).scaleDefault(SCALE_DEFAULT));
Log.v(TAG, "Bin - Created at " + pX + ", " + pY);
id = ID++;
this.type = binType;
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:10,代码来源:Bin.java
示例17: TMXLayer
import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
/**
* This reads in the attributes and creates a standard {@link SpriteBatch}
* which uses a {@link HighPerformanceSpriteBatchVertexBufferObject}
*
* @param pTMXTiledMap
* @param pAttributes
* @param pVertexBufferObjectManager
* @param pAllocateTiles
*/
public TMXLayer(final TMXTiledMap pTMXTiledMap, final Attributes pAttributes,
final VertexBufferObjectManager pVertexBufferObjectManager, boolean pAllocateTiles) {
super(null, SAXUtils.getIntAttributeOrThrow(pAttributes, TMXConstants.TAG_LAYER_ATTRIBUTE_WIDTH)
* SAXUtils.getIntAttributeOrThrow(pAttributes, TMXConstants.TAG_LAYER_ATTRIBUTE_HEIGHT),
pVertexBufferObjectManager);
this.mTMXTiledMap = pTMXTiledMap;
this.mName = pAttributes.getValue("", TMXConstants.TAG_LAYER_ATTRIBUTE_NAME);
this.mTileColumns = SAXUtils.getIntAttributeOrThrow(pAttributes, TMXConstants.TAG_LAYER_ATTRIBUTE_WIDTH);
this.mTileRows = SAXUtils.getIntAttributeOrThrow(pAttributes, TMXConstants.TAG_LAYER_ATTRIBUTE_HEIGHT);
if (pAllocateTiles) {
this.mAllocateTMXTiles = true;
this.mTMXTiles = new TMXTile[this.mTileRows][this.mTileColumns];
} else {
this.mAllocateTMXTiles = false;
this.mTMXTiles = null;
}
this.mTileGID = new int[this.mTileRows][this.mTileColumns];
this.mStoreGID = this.mTMXTiledMap.getStoreGID();
this.mWidth = pTMXTiledMap.getTileWidth() * this.mTileColumns;
this.mHeight = pTMXTiledMap.getTileHeight() * this.mTileRows;
this.mRotationCenterX = this.mWidth * 0.5f;
this.mRotationCenterY = this.mHeight * 0.5f;
this.mScaleCenterX = this.mRotationCenterX;
this.mScaleCenterY = this.mRotationCenterY;
this.mGlobalTileIDsExpected = this.mTileColumns * this.mTileRows;
this.setVisible(SAXUtils.getIntAttribute(pAttributes, TMXConstants.TAG_LAYER_ATTRIBUTE_VISIBLE,
TMXConstants.TAG_LAYER_ATTRIBUTE_VISIBLE_VALUE_DEFAULT) == 1);
this.setAlpha(SAXUtils.getFloatAttribute(pAttributes, TMXConstants.TAG_LAYER_ATTRIBUTE_OPACITY,
TMXConstants.TAG_LAYER_ATTRIBUTE_OPACITY_VALUE_DEFAULT));
if (this.mTMXTiledMap.getOrientation().equals(TMXConstants.TAG_MAP_ATTRIBUTE_ORIENTATION_VALUE_ISOMETRIC)) {
// Paul Robinson
// Calculate the half of the tile height and width, saves doing it
// later
this.mIsoHalfTileHeight = this.mTMXTiledMap.getTileHeight() / 2;
this.mIsoHalfTileWidth = this.mTMXTiledMap.getTileWidth() / 2;
this.tileratio = this.mTMXTiledMap.getTileWidth() / this.mTMXTiledMap.getTileHeight();
this.setIsometricDrawMethod(this.mTMXTiledMap.getIsometricDrawMethod());
}
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:56,代码来源:TMXLayer.java
示例18: SessionSprite
import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public SessionSprite(float px, float py, GameSession session, VertexBufferObjectManager vbo) {
super(px, py, PhoeniciaGame.PERSON_TILE_WIDTH, PhoeniciaGame.PERSON_TILE_HEIGHT+32);
Debug.d("Adding SessionSprite as "+px+","+py);
this.session = session;
if (session.session_name.get() == null) {
Debug.d("Session has no name, setting it to Player " + (sessionSprites.size() + 1));
session.session_name.set("Player "+(sessionSprites.size()+1));
//session.session_name.set("Mchezaji"+(sessionSprites.size()+1));
session.save(PhoeniciaContext.context);
}
Debug.i("Adding Game session: " + session.session_name.get() + " in " + session.locale_pack.get());
LocaleLoader localeLoader = new LocaleLoader();
Locale session_locale;
try {
session_locale = localeLoader.load(PhoeniciaContext.assetManager.open(session.locale_pack.get()));
Person currentPerson = session_locale.person_map.get(session.person_name.get());
if (currentPerson == null) {
Debug.w("Game Session without person!");
// TODO: use an "unknown user" image instead
int person_index = sessionSprites.size() % session_locale.people.size();
currentPerson = session_locale.people.get(person_index);
session.person_name.set(currentPerson.name);
session.save(PhoeniciaContext.context);
}
AssetBitmapTexture texture = new AssetBitmapTexture(PhoeniciaContext.textureManager, PhoeniciaContext.assetManager, currentPerson.texture_src);
texture.load();
ITextureRegion personRegion = TextureRegionFactory.extractFromTexture(texture, 0, 0, game.PERSON_TILE_WIDTH, game.PERSON_TILE_HEIGHT);
block = new ButtonSprite(this.getWidth()/2, py, personRegion, PhoeniciaContext.vboManager);
personName = new Text(block.getWidth()/2, -16, GameFonts.dialogText(), session.session_name.get(), session.session_name.get().length(), new TextOptions(AutoWrap.WORDS, 256, HorizontalAlign.CENTER), PhoeniciaContext.vboManager);
//block.attachChild(personName);
Texture newShell = new AssetBitmapTexture(PhoeniciaContext.textureManager, PhoeniciaContext.assetManager, session_locale.shell_src);
newShell.load();
final int GU = 96;
ITextureRegion levelRegion = TextureRegionFactory.extractFromTexture(newShell, GU*5, GU*0, GU*3, GU*1);
final ButtonSprite levelIcon = new ButtonSprite(block.getWidth()/2, (0 - levelRegion.getHeight()/2), levelRegion, PhoeniciaContext.vboManager);
String current_level = session.current_level.get();
if (current_level == null) current_level = "0";
final Text levelName = new Text(160, levelIcon.getHeight()/2, GameFonts.defaultHUDDisplay(), current_level, 4, PhoeniciaContext.vboManager);
levelIcon.attachChild(levelName);
block.attachChild(levelIcon);
this.attachChild(block);
} catch (final IOException e) {
Debug.e("Failed to load game session person!", e);
}
clickDetector = new ClickDetector(this);
holdDetector = new HoldDetector(this);
holdDetector.setTriggerHoldMinimumMilliseconds(2000);
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:55,代码来源:SessionSelectionScene.java
示例19: ToggleSprite
import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public ToggleSprite(final float pX, final float pY, ITiledTextureRegion textureRegion, VertexBufferObjectManager vertexBufferObjectManager) {
super(pX, pY, textureRegion, vertexBufferObjectManager);
this.clickDetector = new ClickDetector(this);
this.enabled = true;
this.setCurrentTileIndex(0);
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:7,代码来源:ToggleSprite.java
示例20: SpriteGroup
import org.andengine.opengl.vbo.VertexBufferObjectManager; //导入依赖的package包/类
public SpriteGroup(final float pX, final float pY, final float width, final float height, final Sprite srcSprite, final int quantity, final VertexBufferObjectManager vertexBufferObjectManager) {
this(pX, pY, width, height, srcSprite, quantity, vertexBufferObjectManager, null);
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:4,代码来源:SpriteGroup.java
注:本文中的org.andengine.opengl.vbo.VertexBufferObjectManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论