當前位置: 首頁>>代碼示例>>Java>>正文


Java Format.RGB565屬性代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.Pixmap.Format.RGB565屬性的典型用法代碼示例。如果您正苦於以下問題:Java Format.RGB565屬性的具體用法?Java Format.RGB565怎麽用?Java Format.RGB565使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.badlogic.gdx.graphics.Pixmap.Format的用法示例。


在下文中一共展示了Format.RGB565屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Renderer

public Renderer () {
	try {
		lights = new Environment();
		lights.add(new DirectionalLight().set(Color.WHITE, new Vector3(-1, -0.5f, 0).nor()));

		spriteBatch = new SpriteBatch();
		modelBatch = new ModelBatch();

		backgroundTexture = new Texture(Gdx.files.internal("data/planet.jpg"), Format.RGB565, true);
		backgroundTexture.setFilter(TextureFilter.MipMap, TextureFilter.Linear);

		font = new BitmapFont(Gdx.files.internal("data/font10.fnt"), Gdx.files.internal("data/font10.png"), false);

		camera = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	} catch (Exception ex) {
		ex.printStackTrace();
	}
}
 
開發者ID:Motsai,項目名稱:neblina-libgdx3d,代碼行數:18,代碼來源:Renderer.java

示例2: show

@Override
public void show () {
	font = new BitmapFont(Gdx.files.internal("fonts/font.fnt"));
	cache = font.getCache();

	if (Gdx.app.getType() == ApplicationType.Android)
		font.getData().setScale(2);
	polygonBatch = new PolygonSpriteBatch();
	camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

	Pixmap pixMap = new Pixmap(1, 1, Format.RGB565);
	pixMap.setColor(Color.WHITE);
	pixMap.fill();
	emptyTexture = new Texture(pixMap);
	pixMap.dispose();
}
 
開發者ID:Quexten,項目名稱:RavTech,代碼行數:16,代碼來源:RemoteEditLoadingScreen.java

示例3: generateCharacter

public static Texture generateCharacter() {
	pixmap = new Pixmap(4, 4, Format.RGB565);
	
	//fill square
	pixmap.setColor(0.5f, 0.5f, 0.5f, 1);
	pixmap.fill();
	
	//draw face/eyes (front of character)
	pixmap.setColor(0, 1, 1, 1);
	pixmap.drawPixel(3, 2);
	pixmap.drawPixel(3, 1);
	
	Texture t = new Texture(pixmap);
	pixmap.dispose(); 
	return t;
}
 
開發者ID:0XDE57,項目名稱:SpaceProject,代碼行數:16,代碼來源:TextureFactory.java

示例4: loadAsync

@Override
public void loadAsync(AssetManager manager, String fileName, FileHandle file, TextureParameter parameter) {
    info.filename = fileName;
    if (parameter == null || parameter.textureData == null) {
        info.texture = null;

        if (parameter != null) {
            info.texture = parameter.texture;
        }

        info.data = new PixmapTextureData(null, Format.RGB565, false, false);
    } else {
        info.data = parameter.textureData;
        info.texture = parameter.texture;
    }
}
 
開發者ID:kibertoad,項目名稱:swampmachine,代碼行數:16,代碼來源:HeadlessTextureLoader.java

示例5: setupScene

public void setupScene () {
	plane = new Mesh(true, 4, 6, new VertexAttribute(Usage.Position, 3, ShaderProgram.POSITION_ATTRIBUTE), new VertexAttribute(
		Usage.Normal, 3, ShaderProgram.NORMAL_ATTRIBUTE));
	plane.setVertices(new float[] {-10, -1, 10, 0, 1, 0, 10, -1, 10, 0, 1, 0, 10, -1, -10, 0, 1, 0, -10, -1, -10, 0, 1, 0});
	plane.setIndices(new short[] {3, 2, 1, 1, 0, 3});

	texture = new Texture(Gdx.files.internal("data/badlogic.jpg"), Format.RGB565, true);
	texture.setFilter(TextureFilter.MipMap, TextureFilter.Nearest);

	cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	cam.position.set(0, 5, 10);
	cam.lookAt(0, 0, 0);
	cam.update();
	controller = new PerspectiveCamController(cam);

	projector = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	projector.position.set(2, 3, 2);
	projector.lookAt(0, 0, 0);
	projector.normalizeUp();
	projector.update();
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:21,代碼來源:ProjectiveTextureTest.java

示例6: create

@Override
public void create () {
	mesh = new Mesh(true, 3, 0, new VertexAttribute(Usage.Position, 3, "a_Position"), new VertexAttribute(Usage.ColorPacked, 4,
		"a_Color"), new VertexAttribute(Usage.TextureCoordinates, 2, "a_texCoords"));
	float c1 = Color.toFloatBits(255, 0, 0, 255);
	float c2 = Color.toFloatBits(255, 0, 0, 255);
	float c3 = Color.toFloatBits(0, 0, 255, 255);

	mesh.setVertices(new float[] {-0.5f, -0.5f, 0, c1, 0, 0, 0.5f, -0.5f, 0, c2, 1, 0, 0, 0.5f, 0, c3, 0.5f, 1});

	stencilMesh = new Mesh(true, 3, 0, new VertexAttribute(Usage.Position, 3, "a_Position"), new VertexAttribute(
		Usage.ColorPacked, 4, "a_Color"), new VertexAttribute(Usage.TextureCoordinates, 2, "a_texCoords"));
	stencilMesh.setVertices(new float[] {-0.5f, 0.5f, 0, c1, 0, 0, 0.5f, 0.5f, 0, c2, 1, 0, 0, -0.5f, 0, c3, 0.5f, 1});

	texture = new Texture(Gdx.files.internal("data/badlogic.jpg"));

	spriteBatch = new SpriteBatch();
	frameBuffer = new FrameBuffer(Format.RGB565, 128, 128, false);
	stencilFrameBuffer = new FrameBuffer(Format.RGB565, 128, 128, false, true);
	createShader(Gdx.graphics);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:21,代碼來源:FrameBufferTest.java

示例7: create

@Override
public void create () {
	FileHandle file = Gdx.files.internal("data/bobargb8888-32x32.png");
	nonMipMapped[0] = new Texture(file, Format.Alpha, false);
	nonMipMapped[1] = new Texture(file, Format.LuminanceAlpha, false);
	nonMipMapped[2] = new Texture(file, Format.RGB888, false);
	nonMipMapped[3] = new Texture(file, Format.RGB565, false);
	nonMipMapped[4] = new Texture(file, Format.RGBA8888, false);
	nonMipMapped[5] = new Texture(file, Format.RGBA4444, false);

	mipMapped[0] = new Texture(file, Format.Alpha, true);
	mipMapped[1] = new Texture(file, Format.LuminanceAlpha, true);
	mipMapped[2] = new Texture(file, Format.RGB888, true);
	mipMapped[3] = new Texture(file, Format.RGB565, true);
	mipMapped[4] = new Texture(file, Format.RGBA8888, true);
	mipMapped[5] = new Texture(file, Format.RGBA4444, true);

	batch = new SpriteBatch();
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:19,代碼來源:TextureFormatTest.java

示例8: create

@Override
public void create () {
	font = new BitmapFont();
	camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	controller = new OrthoCamController(camera);
	Gdx.input.setInputProcessor(controller);

	Pixmap pixmap = new Pixmap(32, 32, Format.RGB565);
	pixmap.setColor(1, 0, 0, 1);
	pixmap.fill();
	pixmap.setColor(0, 1, 0, 1);
	pixmap.drawLine(0, 0, 32, 32);
	pixmap.drawLine(0, 32, 32, 0);
	ETC1Data encodedImage = ETC1.encodeImagePKM(pixmap);
	pixmap.dispose();
	pixmap = ETC1.decodeImage(encodedImage, Format.RGB565);
	encodedImage.dispose();

	img1 = new Texture(pixmap);
	img2 = new Texture("data/test.etc1");
	batch = new SpriteBatch();
	pixmap.dispose();
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:23,代碼來源:ETC1Test.java

示例9: create

@Override
public void create () {
	spriteBatch = new SpriteBatch();
	texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg"));

	Pixmap pixmap = new Pixmap(32, 32, Format.RGB565);
	pixmap.setColor(1, 1, 0, 0.7f);
	pixmap.fill();
	texture2 = new Texture(pixmap);
	pixmap.dispose();

	for (int i = 0; i < coords.length; i += 2) {
		coords[i] = (int)(Math.random() * Gdx.graphics.getWidth());
		coords[i + 1] = (int)(Math.random() * Gdx.graphics.getHeight());
		coords2[i] = (int)(Math.random() * Gdx.graphics.getWidth());
		coords2[i + 1] = (int)(Math.random() * Gdx.graphics.getHeight());
	}
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:18,代碼來源:SpriteBatchShaderTest.java

示例10: PostProcessor

/** Construct a new PostProcessor with the given parameters and the specified texture wrap mode */
public PostProcessor (int fboWidth, int fboHeight, boolean useDepth, boolean fsaa, boolean useAlphaChannel, boolean use32Bits,
	TextureWrap u, TextureWrap v) {
	if (use32Bits) {
		if (useAlphaChannel) {
			fbFormat = Format.RGBA8888;
		} else {
			fbFormat = Format.RGB888;
		}
	} else {
		if (useAlphaChannel) {
			fbFormat = Format.RGBA4444;
		} else {
			fbFormat = Format.RGB565;
		}
	}

	composite = newPingPongBuffer(fboWidth, fboHeight, fbFormat, useDepth, fsaa);
	setBufferTextureWrap(u, v);

	pipelineState = new PipelineState();

	capturing = false;
	hasCaptured = false;
	enabled = true;
	this.useDepth = useDepth;
	if (useDepth) {
		clearBits |= GL20.GL_DEPTH_BUFFER_BIT;
	}

	setViewport(null);
}
 
開發者ID:Osaris31,項目名稱:exterminate,代碼行數:32,代碼來源:PostProcessor.java

示例11: PolygonShapeRenderer

public PolygonShapeRenderer (RavCamera camera) {
	this.camera = camera;
	Pixmap pixmap = new Pixmap(1, 1, Format.RGB565);
	pixmap.setColor(Color.WHITE);
	pixmap.fill();
	texture = new Texture(pixmap);
	pixmap.dispose();
}
 
開發者ID:Quexten,項目名稱:RavTech,代碼行數:8,代碼來源:PolygonShapeRenderer.java

示例12: SortedRenderer

public SortedRenderer (ShaderManager shaderManager) {
	this.shaderManager = shaderManager;
	Pixmap pixmap = new Pixmap(1, 1, Format.RGB565);
	pixmap.setColor(Color.WHITE);
	pixmap.fill();
	ambientTexture = new Texture(pixmap);
	pixmap.dispose();
}
 
開發者ID:Quexten,項目名稱:RavTech,代碼行數:8,代碼來源:SortedRenderer.java

示例13: PostProcessor

/**
 * Construct a new PostProcessor with the given parameters and the specified texture wrap mode
 */
public PostProcessor(int fboWidth, int fboHeight, boolean useDepth, boolean useAlphaChannel, boolean use32Bits,
      TextureWrap u, TextureWrap v) {
   if (use32Bits) {
      if (useAlphaChannel) {
         fbFormat = Format.RGBA8888;
      } else {
         fbFormat = Format.RGB888;
      }
   } else {
      if (useAlphaChannel) {
         fbFormat = Format.RGBA4444;
      } else {
         fbFormat = Format.RGB565;
      }
   }

   composite = newPingPongBuffer(fboWidth, fboHeight, fbFormat, useDepth);
   setBufferTextureWrap(u, v);

   pipelineState = new PipelineState();

   capturing = false;
   hasCaptured = false;
   enabled = true;
   this.useDepth = useDepth;
   if (useDepth) {
      clearBits |= GL20.GL_DEPTH_BUFFER_BIT;
   }

   setViewport(null);
}
 
開發者ID:bitbrain,項目名稱:braingdx,代碼行數:34,代碼來源:PostProcessor.java

示例14: generateProjectile

public static Texture generateProjectile(int size) {
	pixmap = new Pixmap(size, size/2 == 0 ? 1 : size/2, Format.RGB565);
	pixmap.setColor(1,1,1,1);
	pixmap.fill();
	
	Texture t = new Texture(pixmap);
	pixmap.dispose(); 
	return t;
}
 
開發者ID:0XDE57,項目名稱:SpaceProject,代碼行數:9,代碼來源:TextureFactory.java

示例15: createShip

@Deprecated
public static Entity createShip(int x, int y) {
	Entity entity = new Entity();

	TransformComponent transform = new TransformComponent();
	TextureComponent texture = new TextureComponent();

	transform.pos.set(x, y, -10);
	transform.rotation = (float) Math.PI/2; //face upwards
	
	// generate pixmap texture
	int size = 16;
	Pixmap pixmap = new Pixmap(size, size, Format.RGB565);
	pixmap.setColor(1, 1, 1, 1);
	pixmap.fillTriangle(0, 0, 0, size-1, size-1, size/2);
	
	pixmap.setColor(0, 1, 1, 1);
	pixmap.drawLine(size, size/2, size/2, size/2);
	
	
	Texture pixmapTex = new Texture(pixmap);
	pixmap.dispose(); // clean up
	texture.texture = pixmapTex;// give texture component the generated pixmapTexture
	texture.scale = SpaceProject.scale;
	
	BoundsComponent bounds = new BoundsComponent();
	float width = texture.texture.getWidth() * SpaceProject.scale;
	float height = texture.texture.getHeight() * SpaceProject.scale;
	bounds.poly = new Polygon(new float[]{0, 0, width, 0, width, height, 0, height});
    bounds.poly.setOrigin(width/2, height/2);

	
	entity.add(bounds);
	entity.add(texture);
	entity.add(transform);
	entity.add(new VehicleComponent());
	
	return entity;
}
 
開發者ID:0XDE57,項目名稱:SpaceProject,代碼行數:39,代碼來源:EntityFactory.java


注:本文中的com.badlogic.gdx.graphics.Pixmap.Format.RGB565屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。