Ejemplo n.º 1
0
  @Override
  protected void drawBackground(
      LiveGameData gameData,
      boolean isEditorMode,
      TextureImage2D texture,
      int offsetX,
      int offsetY,
      int width,
      int height,
      boolean isRoot) {
    texture.clear(imgName.getTexture(), offsetX + width * 6 / 100, offsetY, false, null);

    if (ShowAmbiant.getValue())
      texture.clear(imgName.getTexture(), offsetX, offsetY + height / 2, false, null);
  }
Ejemplo n.º 2
0
  @Override
  protected void drawWidget(
      Clock clock,
      boolean needsCompleteRedraw,
      LiveGameData gameData,
      boolean isEditorMode,
      TextureImage2D texture,
      int offsetX,
      int offsetY,
      int width,
      int height) {

    AmbientTemp.update((int) Math.floor(gameData.getWeatherInfo().getAmbientTemperature()));
    TrackTemp.update((int) Math.floor(gameData.getWeatherInfo().getTrackTemperature()));

    if (ShowAmbiant.getValue() && (needsCompleteRedraw || AmbientTemp.hasChanged())) {
      dsAmbient.draw(offsetX, offsetY, Loc.ambiant_temp, texture);
      dsAmbientTemp.draw(offsetX, offsetY, AmbientTemp.getValueAsString(), texture);
    }
    if (needsCompleteRedraw || TrackTemp.hasChanged()) {
      dsTrack.draw(offsetX, offsetY, Loc.track_temp, texture);
      dsTrackTemp.draw(offsetX, offsetY, TrackTemp.getValueAsString(), texture);
    }
  }