예제 #1
0
		private void AddIndicesAndVerticesForGlyph(Batch2D batch, GlyphDrawData glyph)
		{
			batch.AddIndices();
			batch.verticesColorUV[batch.verticesIndex++] = new VertexPosition2DColorUV(
				position + glyph.DrawArea.TopLeft, color, glyph.UV.TopLeft);
			batch.verticesColorUV[batch.verticesIndex++] = new VertexPosition2DColorUV(
				position + glyph.DrawArea.BottomLeft, color, glyph.UV.BottomLeft);
			batch.verticesColorUV[batch.verticesIndex++] = new VertexPosition2DColorUV(
				position + glyph.DrawArea.BottomRight, color, glyph.UV.BottomRight);
			batch.verticesColorUV[batch.verticesIndex++] = new VertexPosition2DColorUV(
				position + glyph.DrawArea.TopRight, color, glyph.UV.TopRight);
		}
예제 #2
0
 private void AddIndicesAndVerticesForGlyph(Batch2D batch, GlyphDrawData glyph)
 {
     batch.AddIndices();
     batch.verticesColorUV[batch.verticesIndex++] = new VertexPosition2DColorUV(
         position + glyph.DrawArea.TopLeft, color, glyph.UV.TopLeft);
     batch.verticesColorUV[batch.verticesIndex++] = new VertexPosition2DColorUV(
         position + glyph.DrawArea.BottomLeft, color, glyph.UV.BottomLeft);
     batch.verticesColorUV[batch.verticesIndex++] = new VertexPosition2DColorUV(
         position + glyph.DrawArea.BottomRight, color, glyph.UV.BottomRight);
     batch.verticesColorUV[batch.verticesIndex++] = new VertexPosition2DColorUV(
         position + glyph.DrawArea.TopRight, color, glyph.UV.TopRight);
 }
예제 #3
0
        private void AddIndicesAndVerticesForTrackPart(Batch2D batch, int index)
        {
            batch.AddIndices();
            float uvStep = (index % UVLength) / (float)UVLength;

            batch.verticesUV[batch.verticesIndex++] = new VertexPosition2DUV(
                screen.ToPixelSpace(outerBounds[index]), new Vector2D(0, uvStep));
            batch.verticesUV[batch.verticesIndex++] = new VertexPosition2DUV(
                screen.ToPixelSpace(innerBounds[index]), new Vector2D(1, uvStep));
            uvStep = ((index % UVLength) + 1) / (float)UVLength;
            batch.verticesUV[batch.verticesIndex++] = new VertexPosition2DUV(
                screen.ToPixelSpace(innerBounds[(index + 1) % innerBounds.Length]), new Vector2D(1, uvStep));
            batch.verticesUV[batch.verticesIndex++] = new VertexPosition2DUV(
                screen.ToPixelSpace(outerBounds[(index + 1) % outerBounds.Length]), new Vector2D(0, uvStep));
        }
예제 #4
0
 private void AddSlotIndicesAndVertices(float[] uvs)
 {
     if (isNormalTriangleWindingOrder)
     {
         currentBatch.AddIndices();
     }
     else
     {
         currentBatch.AddIndicesReversedWinding();
     }
     currentBatch.verticesColorUV[currentBatch.verticesIndex++] = GetTopLeftVertex(uvs);
     currentBatch.verticesColorUV[currentBatch.verticesIndex++] = GetBottomLeftVertex(uvs);
     currentBatch.verticesColorUV[currentBatch.verticesIndex++] = GetBottomRightVertex(uvs);
     currentBatch.verticesColorUV[currentBatch.verticesIndex++] = GetTopRightVertex(uvs);
 }