示例#1
0
 public void renderSimulation(TextureRegion ropeNormalImage, TextureRegion ropeBurnedImage) {
   for (int i = 0; i < nodes.size() - 1; i++) {
     if (nodes.get(i).isActive())
       pathRenderer.renderPathSegment(nodes.get(i), nodes.get(i + 1), ropeBurnedImage);
     else pathRenderer.renderPathSegment(nodes.get(i), nodes.get(i + 1), ropeNormalImage);
   }
   if (!pathRenderer.onceDrawn) {
     pathRenderer.onceDrawn = true;
     //			Helper.println("\n\n");
   }
 }
示例#2
0
  public void renderPoints(TextureRegion ropeTexture) {
    //		time = System.currentTimeMillis();

    if (image != null) ropeTexture = image;

    for (int i = 0; i < nodes.size() - 1; i++) {
      if (nodes.get(i).isActive())
        pathRenderer.renderPathSegment(nodes.get(i), nodes.get(i + 1), ropeTexture, renderWidth);
      else {
        GlobalVars.ge.getRenderer().getScreen().getBatch().setColor(1, 1, 1, 0.4f);
        pathRenderer.renderPathSegment(nodes.get(i), nodes.get(i + 1), imageInActive, renderWidth);
        GlobalVars.ge.getRenderer().getScreen().getBatch().setColor(1, 1, 1, 1);
      }
    }

    //		counter = 0;
    //		for (int i = 0; i < segmentPoints.size() - 1; i++) {
    //			if(i%2f == 0)
    //				continue;
    //			pathRenderer.renderPathSegment(segmentPoints.get(i), segmentPoints
    //					.get(i + 1), ropeTexture, renderingSegmentSize);

    //			if (counter == 0)
    //				counter = 1;
    //			else
    //				counter = 0;
    //			pathRenderer.renderPathSegment(segmentPoints.get(i), segmentPoints
    //					.get(i + 1), (counter == 0) ? ropeTexture : Helper
    //					.getImageFromAssets(AssetConstants.IMG_BKG_PURPLE), 5);
    //		}

    //		if (!pathRenderer.onceDrawn) {
    //			pathRenderer.onceDrawn = true;
    ////			Helper.println("\n\n");
    ////			Helper.printKeyVal("Total Distance: ", "" + calculateTotalDistance());
    //		}
    //		GlobalVars.ge.getRenderer().getBatch().setColor(1f, 1f, 1f, 1f);
    //		System.out.println("" + (System.currentTimeMillis() - time));
  }