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


Java ITexture类代码示例

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


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

示例1: getTileSetTexture

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
/**
 * Get the {@link ITexture} mapped to a given tileset image source.<br>
 * If a source is mapped to a texture which is null, the mapping will be
 * removed and a warning printed to the log.
 * 
 * @param pTileSetImageSource
 *            {@link String} of tileset image source
 * @return {@link ITexture} to use <b>OR</b> <code>null</code> if no mapping
 *         exists.
 */
public ITexture getTileSetTexture(String pTileSetImageSource) {
	// Check if a mapping exists
	if (this.mTextureMappedToTileSetAddress.containsKey(pTileSetImageSource)) {
		// Check if the found mapping is null
		ITexture found = this.mTextureMappedToTileSetAddress.get(pTileSetImageSource);
		if (found == null) {
			// Mapping out of date, as texture is null.
			Log.w(TAG, "It appears the image source texture is null, removing mapping " + pTileSetImageSource);
			this.removeMapping(pTileSetImageSource);
			return null;
		} else {
			// Got a texture which is not null so return
			return found;
		}
	} else {
		return null;
	}
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:29,代码来源:TMXTileSetSourceManager.java

示例2: TextureRegion

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public TextureRegion(final ITexture pTexture, final float pTextureX, final float pTextureY, final float pTextureWidth, final float pTextureHeight, final float pScale, final boolean pRotated) {
	super(pTexture);

	this.mTextureX = pTextureX;
	this.mTextureY = pTextureY;

	this.mRotated = pRotated;
	if (this.mRotated) {
		this.mTextureWidth = pTextureHeight;
		this.mTextureHeight = pTextureWidth;
	} else {
		this.mTextureWidth = pTextureWidth;
		this.mTextureHeight = pTextureHeight;
	}

	this.mScale = pScale;

	this.updateUV();
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:20,代码来源:TextureRegion.java

示例3: updateUV

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public void updateUV() {
		final ITexture texture = this.mTexture;
		final float textureWidth = texture.getWidth();
		final float textureHeight = texture.getHeight();

		final float x = this.getTextureX();
		final float y = this.getTextureY();

		this.mU = x / textureWidth;
		this.mU2 = (x + this.mTextureWidth) / textureWidth;

		this.mV = y / textureHeight;
		this.mV2 = (y + this.mTextureHeight) / textureHeight;

//		this.mU = (x + 0.5f) / textureWidth;
//		this.mU2 = (x + this.mTextureWidth - 0.5f) / textureWidth;
//
//		this.mV = (y + 0.5f) / textureHeight;
//		this.mV2 = (y + this.mTextureHeight - 0.5f) / textureHeight;
	}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:21,代码来源:TextureRegion.java

示例4: doInBackground

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
@Override
protected Sprite doInBackground(final String... params) {
    try {
        ITexture mTexture = new BitmapTexture(engine.getTextureManager(), new IInputStreamOpener() {
            @Override
            public InputStream open() throws IOException {

                URL url = new URL(params[0]);

                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                connection.setDoInput(true);
                connection.connect();
                InputStream input = connection.getInputStream();
                return new BufferedInputStream(input);
            }
        });
        mTexture.load();
        textureRegionAnotherPlayer = TextureRegionFactory.extractFromTexture(mTexture);
        if (GameManager.getInstance() != null && GameManager.getInstance().players != null &&
                GameManager.getInstance().players.length > 0 && engine != null) {
            IEntity entity = GameManager.getInstance().players[1].tabSprite;
            Sprite user = new Sprite(0, 0, textureRegionAnotherPlayer, engine.getVertexBufferObjectManager());
            user.setWidth(entity.getHeight() - 27);
            user.setHeight(entity.getHeight() - 27);
            user.setX(-13 + entity.getWidth() / 2);
            user.setY(+4 + entity.getHeight() / 2);
            return user;
        }

    } catch (IOException e) {
        Debug.e(e);
    }
    return null;
}
 
开发者ID:viniciusDSL,项目名称:One-Cachito,代码行数:35,代码来源:ResourceManager.java

示例5: StrokeFont

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public StrokeFont(final FontManager pFontManager, final ITexture pTexture, final Typeface pTypeface, final float pSize, final boolean pAntiAlias, final int pColorARGBPackedInt, final float pStrokeWidth, final int pStrokeColorARGBPackedInt, final boolean pStrokeOnly) {
	super(pFontManager, pTexture, pTypeface, pSize, pAntiAlias, pColorARGBPackedInt);

	this.mStrokeWidth = pStrokeWidth;

	this.mStrokePaint = new Paint();
	this.mStrokePaint.setTypeface(pTypeface);
	this.mStrokePaint.setStyle(Style.STROKE);
	this.mStrokePaint.setStrokeWidth(pStrokeWidth);
	this.mStrokePaint.setColor(pStrokeColorARGBPackedInt);
	this.mStrokePaint.setTextSize(pSize);
	this.mStrokePaint.setAntiAlias(pAntiAlias);

	this.mStrokeOnly = pStrokeOnly;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:16,代码来源:StrokeFont.java

示例6: TiledTextureRegion

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
/**
 * @param pTexture
 * @param pPerformSameTextureSanityCheck checks whether all supplied {@link org.andengine.opengl.texture.region.ITextureRegion} are on the same {@link Texture}
 * @param pTextureRegions
 */
public TiledTextureRegion(final ITexture pTexture, final boolean pPerformSameTextureSanityCheck, final ITextureRegion ... pTextureRegions) {
	super(pTexture);

	this.mTextureRegions = pTextureRegions;
	this.mTileCount = this.mTextureRegions.length;

	if (pPerformSameTextureSanityCheck) {
		for (int i = this.mTileCount - 1; i >= 0; i--) {
			if (pTextureRegions[i].getTexture() != pTexture) {
				throw new IllegalArgumentException("The " + ITextureRegion.class.getSimpleName() + ": '" + pTextureRegions[i].toString() + "' at index: '" + i + "' is not on the same " + ITexture.class.getSimpleName() + ": '" + pTextureRegions[i].getTexture().toString() + "' as the supplied " + ITexture.class.getSimpleName() + ": '" + pTexture.toString() + "'.");
			}
		}
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:20,代码来源:TiledTextureRegion.java

示例7: StrokeFont

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public StrokeFont(final FontManager pFontManager, final ITexture pTexture, final Typeface pTypeface, final float pSize, final boolean pAntiAlias, final int pColorARGBPackedInt, final float pStrokeWidth, final int pStrokeColorARGBPackedInt, final boolean pStrokeOnly) {
	super(pFontManager, pTexture, pTypeface, pSize, pAntiAlias, pColorARGBPackedInt);
	
	this.mStrokeWidth = pStrokeWidth;

	this.mStrokePaint = new Paint();
	this.mStrokePaint.setTypeface(pTypeface);
	this.mStrokePaint.setStyle(Style.STROKE);
	this.mStrokePaint.setStrokeWidth(pStrokeWidth);
	this.mStrokePaint.setColor(pStrokeColorARGBPackedInt);
	this.mStrokePaint.setTextSize(pSize);
	this.mStrokePaint.setAntiAlias(pAntiAlias);

	this.mStrokeOnly = pStrokeOnly;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:16,代码来源:StrokeFont.java

示例8: TexturePackTextureRegion

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public TexturePackTextureRegion(final ITexture pTexture, final int pX, final int pY, final int pWidth, final int pHeight, final int pID, final String pSource, final boolean pRotated, final boolean pTrimmed, final int pSourceX, final int pSourceY, final int pSourceWidth, final int pSourceHeight) {
	super(pTexture, pX, pY, pWidth, pHeight, pRotated);

	this.mID = pID;
	this.mSource = pSource;
	this.mTrimmed = pTrimmed;
	this.mSourceX = pSourceX;
	this.mSourceY = pSourceY;
	this.mSourceWidth = pSourceWidth;
	this.mSourceHeight = pSourceHeight;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:TexturePackTextureRegion.java

示例9: loadMenuFonts

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public void loadMenuFonts() {

        FontFactory.setAssetBasePath("font/");
        final ITexture menuTexture = new BitmapTextureAtlas(mContext.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
        mMenuFont = FontFactory.createFromAsset(mContext.getFontManager(), menuTexture, mContext.getAssets(), "LCD.ttf", 18f, false, android.graphics.Color.BLACK);
        menuTexture.load();
        mMenuFont.load();

    }
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:10,代码来源:ResourceManager.java

示例10: getTexture

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public ITexture getTexture() {
	return this.mTexture;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:4,代码来源:TMXTileSet.java

示例11: SpriteGroup

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public SpriteGroup(final float pX, final float pY, final ITexture pTexture, final int pCapacity, final ISpriteBatchVertexBufferObject pSpriteBatchVertexBufferObject) {
	super(pX, pY, pTexture, pCapacity, pSpriteBatchVertexBufferObject);

	/* Make children not be drawn automatically, as we handle the drawing ourself. */
	this.setChildrenVisible(false);
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:7,代码来源:SpriteGroup.java

示例12: createStroke

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public static StrokeFont createStroke(final FontManager pFontManager, final ITexture pTexture, final Typeface pTypeface, final float pSize, final boolean pAntiAlias, final int pColor, final float pStrokeWidth, final int pStrokeColor) {
	return new StrokeFont(pFontManager, pTexture, pTypeface, pSize, pAntiAlias, pColor, pStrokeWidth, pStrokeColor);
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:4,代码来源:FontFactory.java

示例13: DynamicSpriteBatch

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public DynamicSpriteBatch(final ITexture pTexture, final int pCapacity, final ISpriteBatchVertexBufferObject pSpriteBatchVertexBufferObject, final ShaderProgram pShaderProgram) {
	super(pTexture, pCapacity, pSpriteBatchVertexBufferObject, pShaderProgram);
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:4,代码来源:DynamicSpriteBatch.java

示例14: extractFromTexture

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public static TextureRegion extractFromTexture(final ITexture pTexture, final boolean pRotated) {
	return new TextureRegion(pTexture, 0, 0, pTexture.getWidth(), pTexture.getHeight(), pRotated);
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:4,代码来源:TextureRegionFactory.java

示例15: create

import org.andengine.opengl.texture.ITexture; //导入依赖的package包/类
public static Font create(final FontManager pFontManager, final ITexture pTexture, final Typeface pTypeface, final float pSize, final boolean pAntiAlias, final int pColor) {
	return new Font(pFontManager, pTexture, pTypeface, pSize, pAntiAlias, pColor);
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:4,代码来源:FontFactory.java


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