local fuelConsumption = 0.00050 -- Fetch this from car.ini/[FUEL] section (couldn't figure out ac.readDataFile())
local currentLitersAvailable = car.fuel
local maxMiles = 440.96 -- Maximum range for the car to drive with a full tank (in miles) 
local bg = "COMFORTCLUSTER.dds"

function RenderBG()
  display.image{ image = bg, pos = vec2(0,0), size = vec2(1024,1024), uvStart = vec2(0,0), uvEnd = vec2(1, 1) }
end

currentLiters100 = (car.rpm * car.gas * fuelConsumption)/1000 --Fuel consumption. In one second the consumption is (rpm*gas*CONSUMPTION)/1000 litres
currentLitersAvailable = car.fuel - currentLiters100 --Current liters available in the tank
currentRange = math.max(0,currentLitersAvailable * maxMiles/90) --Current mileage range


function update(dt)
-----------------------------------------FUEL RANGE


    display.text{
        text = "ODOMETER:",
        pos = vec2(210,130),
        letter = vec2(24,68),
        font = "pixelbig",
        color = rgbm(1,1,1,1), 
        width = 0.5,
        spacing = -1.0,
        alignment = -1.0
      
    }
    display.text{
      text = "MI",
      pos = vec2(837,130),
      letter = vec2(24,68),
      font = "pixelbig",
      color = rgbm(1,1,1,1), 
      width = 0.5,
      spacing = -1.0,
      alignment = -1.0
    
  }
------------------------------MI TEXT FOR TRIP AND ODOMETER
display.text{
    text = string.format("%07.0f", car.distanceDrivenTotalKm), -----------------------TOTAL DISTANCE
    pos = vec2(650,130),
    letter = vec2(24, 68),
    font = "pixelbig",
    color = rgbm(1,1,1,1), 
    width = 0.5,
    spacing = 0,
    alignment = -1.0
  }



 


end