Facebook
From navidjz, 1 Month ago, written in Lua.
Embed
Download Paste or View Raw
Hits: 145
  1. local screensize = vec2(ac.getSim().windowWidth,ac.getSim().windowHeight)
  2. local timer = 5
  3.  
  4. }
  5.  
  6. --image_1 is used as the icon
  7. local image_1 = {
  8.     ['src'] = 'https://s8.uupload.ir/files/fix_vsn.png',
  9.     ['sizeX'] = 256,
  10.     ['sizeY'] = 64,
  11.     ['paddingX'] = 25, --use this to align it, currently 50 pixels from top right
  12.     ['paddingY'] = 1000 --use this to align it, currently 50 pixels from top right
  13. }
  14.  
  15. --this waits for the driver to not be in the setup screen, then starts the timer for the rule splash image
  16. function script.update(dt)
  17.     ac.debug('isInMainMenu', ac.getSim().isInMainMenu)
  18.     if not ac.getSim().isInMainMenu then
  19.         if timer >= 0 then
  20.             timer = timer - dt
  21.         end        
  22.     end
  23. end
  24.  
  25. --this draws the splash screen then after draws the icon
  26. function script.drawUI()
  27.     if timer >= 0 and not ac.getSim().isInMainMenu then
  28.         ui.drawImage(image_0.src, vec2(image_0.paddingX, screensize.y-image_0.sizeY-image_0.paddingY), vec2(image_0.sizeX+image_0.paddingX, screensize.y-image_0.paddingY), true)
  29.     end
  30.     if timer <= 0 then
  31.         ui.drawImage(image_1.src, vec2(image_1.paddingX, image_1.paddingY), vec2(image_1.sizeX+image_1.paddingX, image_1.sizeY+image_1.paddingY), true)
  32.     end
  33. end
  34.