SolidBorder._colors[i + 3] = color.getAlpha() * pAlpha;
}
private static Mesh createMesh() {
// create a triangle strip of 8 triangles.
final Mesh mesh = new Mesh();
mesh.getMeshData().setVertexCoords(new FloatBufferData(BufferUtils.createVector2Buffer(8), 2));
mesh.getMeshData().setColorBuffer(BufferUtils.createColorBuffer(8));
mesh.getMeshData().setIndexMode(IndexMode.TriangleStrip);
final IndexBufferData<?> indices = BufferUtils.createIndexBufferData(10, 7);
indices.put(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1 });
mesh.getMeshData().setIndices(indices);
// set up alpha blending.
final BlendState blend = new BlendState();
blend.setBlendEnabled(true);
blend.setSourceFunction(SourceFunction.SourceAlpha);
blend.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
mesh.setRenderState(blend);
// use flat shade so our borders will have a solid color.
final ShadingState shading = new ShadingState();
shading.setShadingMode(ShadingMode.Flat);
mesh.setRenderState(shading);
mesh.updateWorldRenderStates(false);
return mesh;
}