@Override
 protected void initialize(
     LiveGameData gameData,
     boolean isEditorMode,
     DrawnStringFactory drawnStringFactory,
     TextureImage2D texture,
     int width,
     int height) {
   ds =
       drawnStringFactory.newDrawnString(
           "ds", 0, 0, Alignment.LEFT, false, getFont(), isFontAntiAliased(), getFontColor());
 }
예제 #2
0
  @Override
  protected void initialize(
      LiveGameData gameData,
      boolean isEditorMode,
      DrawnStringFactory drawnStringFactory,
      TextureImage2D texture,
      int width,
      int height) {
    int maxNumItems = numVeh.getValue();
    dsPos = new DrawnString[maxNumItems];
    dsPosTH = new DrawnString[maxNumItems];
    dsNumber = new DrawnString[maxNumItems];
    dsName = new DrawnString[maxNumItems];
    dsTime = new DrawnString[maxNumItems];
    dsPit = new DrawnString[maxNumItems];
    dsPitLabel = new DrawnString[maxNumItems];

    int fh = TextureImage2D.getStringHeight("0%C", getFontProperty());
    int rowHeight = height / maxNumItems;

    imgFord.updateSize(width, rowHeight, isEditorMode);
    imgHolden.updateSize(width, rowHeight, isEditorMode);

    int top = (rowHeight - fh) / 2;

    for (int i = 0; i < maxNumItems; i++) {
      dsPos[i] =
          drawnStringFactory.newDrawnString(
              "dsPos",
              width * 1 / 100 + fontxposoffset.getValue(),
              top + fontyoffset.getValue(),
              Alignment.LEFT,
              false,
              getFont(),
              isFontAntiAliased(),
              fontColor3.getColor());
      dsPosTH[i] =
          drawnStringFactory.newDrawnString(
              "dsPos",
              width * 4 / 100 + fontxposoffset.getValue(),
              top + fontyoffset.getValue(),
              Alignment.LEFT,
              false,
              posFontTH.getFont(),
              isFontAntiAliased(),
              fontColor3.getColor());
      dsNumber[i] =
          drawnStringFactory.newDrawnString(
              "dsNumber",
              width * 13 / 100 + fontxposoffset.getValue(),
              top + fontyoffset.getValue(),
              Alignment.CENTER,
              false,
              getFont(),
              isFontAntiAliased(),
              fontColor2.getColor());
      dsName[i] =
          drawnStringFactory.newDrawnString(
              "dsName",
              width * 19 / 100 + fontxnameoffset.getValue(),
              top + fontyoffset.getValue(),
              Alignment.LEFT,
              false,
              getFont(),
              isFontAntiAliased(),
              fontColor3.getColor());
      dsTime[i] =
          drawnStringFactory.newDrawnString(
              "dsTime",
              width * 84 / 100 + fontxtimeoffset.getValue(),
              top + fontyoffset.getValue(),
              Alignment.RIGHT,
              false,
              getFont(),
              isFontAntiAliased(),
              fontColor2.getColor());
      dsPit[i] =
          drawnStringFactory.newDrawnString(
              "dsTime",
              width * 98 / 100 + fontxtimeoffset.getValue(),
              top + fontyoffset.getValue(),
              Alignment.RIGHT,
              false,
              getFont(),
              isFontAntiAliased(),
              fontColor2.getColor());
      dsPitLabel[i] =
          drawnStringFactory.newDrawnString(
              "dsTime",
              width * 181 / 200 + fontxtimeoffset.getValue(),
              top + fontyoffset.getValue(),
              Alignment.CENTER,
              false,
              getFont(),
              isFontAntiAliased(),
              fontColor3.getColor());

      top += rowHeight;
    }
  }
예제 #3
0
  @Override
  protected void initialize(
      LiveGameData gameData,
      boolean isEditorMode,
      DrawnStringFactory drawnStringFactory,
      TextureImage2D texture,
      int width,
      int height) {
    int fh = TextureImage2D.getStringHeight("0%C", f1_2011Font);

    imgName.updateSize(width * 94 / 100, height / 2, isEditorMode);

    dsAmbient =
        drawnStringFactory.newDrawnString(
            "dsAmbient",
            width * 7 / 100,
            height * 3 / 4 - fh / 2,
            Alignment.LEFT,
            false,
            f1_2011Font.getFont(),
            isFontAntiAliased(),
            WhiteFontColor.getColor(),
            null,
            "");
    dsAmbientTemp =
        drawnStringFactory.newDrawnString(
            "dsAmbientTemp",
            width * 85 / 100,
            height * 3 / 4 - fh / 2,
            Alignment.RIGHT,
            false,
            f1_2011Font.getFont(),
            isFontAntiAliased(),
            WhiteFontColor.getColor(),
            null,
            "°C");

    dsTrack =
        drawnStringFactory.newDrawnString(
            "dsTrack",
            width * 14 / 100,
            height / 4 - fh / 2 + fontyoffset.getValue(),
            Alignment.LEFT,
            false,
            f1_2011Font.getFont(),
            isFontAntiAliased(),
            WhiteFontColor.getColor(),
            null,
            "");
    dsTrackTemp =
        drawnStringFactory.newDrawnString(
            "dsTrackTemp",
            width * 92 / 100,
            height / 4 - fh / 2 + fontyoffset.getValue(),
            Alignment.RIGHT,
            false,
            f1_2011Font.getFont(),
            isFontAntiAliased(),
            WhiteFontColor.getColor(),
            null,
            "°C");
  }
예제 #4
0
  @Override
  protected void initialize(
      LiveGameData gameData,
      boolean isEditorMode,
      DrawnStringFactory drawnStringFactory,
      TextureImage2D texture,
      int width,
      int height) {

    team.update("");
    name.update("");
    pos.update("");
    // gap.update( "" );
    // time.update( "" );

    int rowHeight = height / 2;
    int fh = TextureImage2D.getStringHeight("0", GP2Font);

    imgName.updateSize(width, rowHeight * 95 / 100, isEditorMode);
    imgNameFirst.updateSize(width, rowHeight * 95 / 100, isEditorMode);

    int top1 = (rowHeight - fh) / 2;
    int top2 = rowHeight + (rowHeight - fh) / 2;
    dsName =
        drawnStringFactory.newDrawnString(
            "dsName",
            width * 8 / 100,
            top1 + fontyoffset.getValue(),
            Alignment.LEFT,
            false,
            GP2Font.getFont(),
            isFontAntiAliased(),
            fontColor1.getColor());
    dsTeam =
        drawnStringFactory.newDrawnString(
            "dsTeam",
            width * 8 / 100,
            top2 + fontyoffset.getValue(),
            Alignment.LEFT,
            false,
            GP2Font.getFont(),
            isFontAntiAliased(),
            fontColor1.getColor());
    // Scan Country Folder

    File dir =
        new File(
            gameData.getFileSystem().getImagesFolder().toString()
                + "/prunn/PorscheSupercup/Countries");

    String[] children = dir.list();
    NumOfPNG = 0;
    listPNG = new String[children.length];

    for (int i = 0; i < children.length; i++) {
      // Get filename of file or directory
      String filename = children[i];

      if (filename.substring(filename.length() - 4).toUpperCase().equals(".PNG")) {
        // log(filename.substring( 0, filename.length()-4 ));
        listPNG[NumOfPNG] = filename.substring(0, filename.length() - 4);
        NumOfPNG++;
      }
    }

    // end of scan
  }