本文整理汇总了Java中org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource.getTextureWidth方法的典型用法代码示例。如果您正苦于以下问题:Java IBitmapTextureAtlasSource.getTextureWidth方法的具体用法?Java IBitmapTextureAtlasSource.getTextureWidth怎么用?Java IBitmapTextureAtlasSource.getTextureWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource
的用法示例。
在下文中一共展示了IBitmapTextureAtlasSource.getTextureWidth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LinearGradientFillBitmapTextureAtlasSourceDecorator
import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource; //导入方法依赖的package包/类
public LinearGradientFillBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final IBitmapTextureAtlasSourceDecoratorShape pBitmapTextureAtlasSourceDecoratorShape, final int[] pColors, final float[] pPositions, final LinearGradientDirection pLinearGradientDirection, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
super(pBitmapTextureAtlasSource, pBitmapTextureAtlasSourceDecoratorShape, pTextureAtlasSourceDecoratorOptions);
this.mColors = pColors;
this.mPositions = pPositions;
this.mLinearGradientDirection = pLinearGradientDirection;
this.mPaint.setStyle(Style.FILL);
final int right = pBitmapTextureAtlasSource.getTextureWidth() - 1;
final int bottom = pBitmapTextureAtlasSource.getTextureHeight() - 1;
final float fromX = pLinearGradientDirection.getFromX(right);
final float fromY = pLinearGradientDirection.getFromY(bottom);
final float toX = pLinearGradientDirection.getToX(right);
final float toY = pLinearGradientDirection.getToY(bottom);
this.mPaint.setShader(new LinearGradient(fromX, fromY, toX, toY, pColors, pPositions, TileMode.CLAMP));
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:19,代码来源:LinearGradientFillBitmapTextureAtlasSourceDecorator.java
示例2: RadialGradientFillBitmapTextureAtlasSourceDecorator
import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource; //导入方法依赖的package包/类
public RadialGradientFillBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final IBitmapTextureAtlasSourceDecoratorShape pBitmapTextureAtlasSourceDecoratorShape, final int[] pColors, final float[] pPositions, final RadialGradientDirection pRadialGradientDirection, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
super(pBitmapTextureAtlasSource, pBitmapTextureAtlasSourceDecoratorShape, pTextureAtlasSourceDecoratorOptions);
this.mColors = pColors;
this.mPositions = pPositions;
this.mRadialGradientDirection = pRadialGradientDirection;
this.mPaint.setStyle(Style.FILL);
final int width = pBitmapTextureAtlasSource.getTextureWidth();
final int height = pBitmapTextureAtlasSource.getTextureHeight();
final float centerX = width * 0.5f;
final float centerY = height * 0.5f;
final float radius = Math.max(centerX, centerY);
switch (pRadialGradientDirection) {
case INSIDE_OUT:
this.mPaint.setShader(new RadialGradient(centerX, centerY, radius, pColors, pPositions, TileMode.CLAMP));
break;
case OUTSIDE_IN:
ArrayUtils.reverse(pColors);
this.mPaint.setShader(new RadialGradient(centerX, centerY, radius, pColors, pPositions, TileMode.CLAMP));
break;
}
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:27,代码来源:RadialGradientFillBitmapTextureAtlasSourceDecorator.java
示例3: loadSprite
import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource; //导入方法依赖的package包/类
private Sprite loadSprite(final float pCameraWidth, final float pCameraHeight, final TextureManager pTextureManager, final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final VertexBufferObjectManager pVertexBufferObjectManager) throws IllegalArgumentException {
this.mBitmapTextureAtlas = new BitmapTextureAtlas(pTextureManager, pBitmapTextureAtlasSource.getTextureWidth(), pBitmapTextureAtlasSource.getTextureHeight(), BitmapTextureFormat.RGBA_8888, TextureOptions.REPEATING_NEAREST);
final ITextureRegion textureRegion = BitmapTextureAtlasTextureRegionFactory.createFromSource(this.mBitmapTextureAtlas, pBitmapTextureAtlasSource, 0, 0);
final int width = Math.round(pCameraWidth / this.mScale);
final int height = Math.round(pCameraHeight / this.mScale);
textureRegion.setTextureWidth(width);
textureRegion.setTextureHeight(height);
this.mBitmapTextureAtlas.load();
final Sprite sprite = new Sprite(0, 0, width, height, textureRegion, pVertexBufferObjectManager);
sprite.setScaleCenter(0, 0);
sprite.setScale(this.mScale);
return sprite;
}
示例4: RadialGradientFillBitmapTextureAtlasSourceDecorator
import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource; //导入方法依赖的package包/类
public RadialGradientFillBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final IBitmapTextureAtlasSourceDecoratorShape pBitmapTextureAtlasSourceDecoratorShape, final int[] pColors, final float[] pPositions, final RadialGradientDirection pRadialGradientDirection, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
super(pBitmapTextureAtlasSource, pBitmapTextureAtlasSourceDecoratorShape, pTextureAtlasSourceDecoratorOptions);
this.mColors = pColors;
this.mPositions = pPositions;
this.mRadialGradientDirection = pRadialGradientDirection;
this.mPaint.setStyle(Style.FILL);
final int width = pBitmapTextureAtlasSource.getTextureWidth();
final int height = pBitmapTextureAtlasSource.getTextureHeight();
final float centerX = width * 0.5f;
final float centerY = height * 0.5f;
final float radius = Math.max(centerX, centerY);
switch(pRadialGradientDirection) {
case INSIDE_OUT:
this.mPaint.setShader(new RadialGradient(centerX, centerY, radius, pColors, pPositions, TileMode.CLAMP));
break;
case OUTSIDE_IN:
ArrayUtils.reverse(pColors);
this.mPaint.setShader(new RadialGradient(centerX, centerY, radius, pColors, pPositions, TileMode.CLAMP));
break;
}
}
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:27,代码来源:RadialGradientFillBitmapTextureAtlasSourceDecorator.java
示例5: BaseBitmapTextureAtlasSourceDecorator
import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource; //导入方法依赖的package包/类
public BaseBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
super(pBitmapTextureAtlasSource.getTextureX(), pBitmapTextureAtlasSource.getTextureY(), pBitmapTextureAtlasSource.getTextureWidth(), pBitmapTextureAtlasSource.getTextureHeight());
this.mBitmapTextureAtlasSource = pBitmapTextureAtlasSource;
this.mTextureAtlasSourceDecoratorOptions = (pTextureAtlasSourceDecoratorOptions == null) ? new TextureAtlasSourceDecoratorOptions() : pTextureAtlasSourceDecoratorOptions;
this.mPaint.setAntiAlias(this.mTextureAtlasSourceDecoratorOptions.getAntiAliasing());
}