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


Java Pixmap.setBlending方法代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.Pixmap.setBlending方法的典型用法代码示例。如果您正苦于以下问题:Java Pixmap.setBlending方法的具体用法?Java Pixmap.setBlending怎么用?Java Pixmap.setBlending使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.graphics.Pixmap的用法示例。


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

示例1: initialize

import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
@Override
public void initialize() {
    //Allocate a pixmap big enough to accommodate four banks of pattern
    //tables (bg and spr each for all four banks)
    patternTablePixmap = new Pixmap(128, 1024, Pixmap.Format.RGBA8888);
    //Set blending to none so we can rewrite the pixmap and draw it to the
    //pattern table texture when graphics are regenerated.
    patternTablePixmap.setBlending(Pixmap.Blending.None);

    //Allocate a pixmap the size of one tile for live CHR-RAM updates.
    patternPixmap = new Pixmap(8, 8, Pixmap.Format.RGBA8888);
    patternPixmap.setBlending(Pixmap.Blending.None);

    patternTableTexture = new Texture(patternTablePixmap, false);
    TextureRegion[][] textureRegions = TextureRegion.split(patternTableTexture, 8, 8);
    patternTableSprites = new Sprite[128][16];
    for(int row = 0; row < 128; row++) {
        for(int column = 0; column < 16; column++) {
            TextureRegion textureRegion = textureRegions[row][column];
            patternTableSprites[row][column] = new Sprite(textureRegion);
        }
    }
    initializeMonochromePalette();
}
 
开发者ID:gradualgames,项目名称:ggvm,代码行数:25,代码来源:ChrRamPatternTableManager.java

示例2: initialize

import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
/**
 * Initializes the pattern table textures and pixmap.
 */
public void initialize() {
    //Allocate a pixmap big enough to accommodate both pattern tables.
    patternTablePixmap = new Pixmap(128, 256, Pixmap.Format.RGBA8888);
    //Set blending to none so we can rewrite the pixmap and draw it to the
    //pattern table texture when graphics are regenerated.
    patternTablePixmap.setBlending(Pixmap.Blending.None);

    //Allocate a pixmap the size of one tile for live CHR-RAM updates.
    patternPixmap = new Pixmap(8, 8, Pixmap.Format.RGBA8888);
    patternPixmap.setBlending(Pixmap.Blending.None);

    patternTableTexture = new Texture(patternTablePixmap, false);
    TextureRegion[][] textureRegions = TextureRegion.split(patternTableTexture, 8, 8);
    patternTableSprites = new Sprite[32][16];
    for(int row = 0; row < 32; row++) {
        for(int column = 0; column < 16; column++) {
            TextureRegion textureRegion = textureRegions[row][column];
            patternTableSprites[row][column] = new Sprite(textureRegion);
        }
    }
    initializeMonochromePalette();
}
 
开发者ID:gradualgames,项目名称:ggvm,代码行数:26,代码来源:PatternTableManager.java

示例3: testGraphics

import com.badlogic.gdx.graphics.Pixmap; //导入方法依赖的package包/类
public void testGraphics(){
    Object[] objects = new Object[5];

    objects[0] = new Color(random.nextFloat(), random.nextFloat(), random.nextFloat(), random.nextFloat());

    OrthographicCamera orthographicCamera = new OrthographicCamera();
    orthographicCamera.position.set(randFloat(), randFloat(), randFloat());
    orthographicCamera.viewportWidth = random.nextInt(1000);
    orthographicCamera.viewportHeight = random.nextInt(1000);
    orthographicCamera.zoom = random.nextFloat() * random.nextInt(3);
    orthographicCamera.near = 0.014f;
    orthographicCamera.far = 5000.35f;
    orthographicCamera.up.rotateRad(new Vector3(randFloat(), randFloat(), randFloat()).nor(), randFloat());
    orthographicCamera.update();
    objects[1] = orthographicCamera;

    PerspectiveCamera perspectiveCamera = new PerspectiveCamera();
    perspectiveCamera.position.set(randFloat(), randFloat(), randFloat());
    perspectiveCamera.viewportWidth = random.nextInt(1000);
    perspectiveCamera.viewportHeight = random.nextInt(1000);
    perspectiveCamera.fieldOfView = (random.nextFloat() * 0.5f + 0.5f) * 60;
    perspectiveCamera.near = random.nextFloat() * 5;
    perspectiveCamera.far = (random.nextFloat() * 0.5f + 0.5f) * 5000;
    perspectiveCamera.up.rotateRad(new Vector3(randFloat(), randFloat(), randFloat()).nor(), randFloat());
    perspectiveCamera.update();
    objects[2] = perspectiveCamera;

    Pixmap pixmap = new Pixmap(2, 3, Pixmap.Format.RGBA8888);
    for (int i = 0; i < pixmap.getWidth(); i++) {
        for (int j = 0; j < pixmap.getHeight(); j++) {
            pixmap.drawPixel(i, j, random.nextInt());
        }
    }
    pixmap.setBlending(Pixmap.Blending.None);
    pixmap.setFilter(Pixmap.Filter.NearestNeighbour);
    objects[3] = pixmap;

    Pixmap pixmap2 = new Pixmap(50, 50, Pixmap.Format.RGBA8888);
    for (int i = 0; i < pixmap2.getWidth(); i++) {
        for (int j = 0; j < pixmap2.getHeight(); j++) {
            pixmap2.drawPixel(i, j, random.nextInt());
        }
    }
    pixmap2.setBlending(Pixmap.Blending.SourceOver);
    pixmap2.setFilter(Pixmap.Filter.BiLinear);
    objects[4] = pixmap2;

    Object[] returned = simpleRoundTrip(objects);

    pixmap.dispose();
    pixmap2.dispose();
    ((Pixmap)returned[3]).dispose();
    ((Pixmap)returned[4]).dispose();
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:55,代码来源:GraphicsTest.java


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