Example #1
0
 @Override
 public void generateVertexData() {
   VertexHelper vertex = new VertexHelper(2 * 4 * TOTAL_ELEMENTS);
   // Background
   vertex.put(416, 242, 448, 235);
   // Select Weapon Icon
   addVertex(vertex, chosenWeapon);
   // Weapon Slots
   for (int i = 0; i < TOTAL_ELEMENTS - 1; i++) {
     if (i != chosenWeapon) {
       addVertex(vertex, i);
     }
   }
   renderObject.updateVertex(vertex);
 }
Example #2
0
  private void addVertex(VertexHelper vertex, int i) {
    int xIndex = i % WEAPONS_PER_ROW;
    int yIndex = i / WEAPONS_PER_ROW;

    float x = 32 * xIndex + 433;
    float y = 48 * yIndex + 283;
    vertex.put(x, y, 32, 32);
  }