home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 45 / cda45.iso / intro.dxr / scripts_1_general.ls < prev    next >
Encoding:
Text File  |  2000-04-18  |  4.3 KB  |  169 lines

  1. global spLinea, spListaProgramas, spPrograma, actFoto, despFoto, listaFotos
  2.  
  3. on inicializar
  4.   spListaProgramas = 90
  5.   spPrograma = 110
  6.   despFoto = 274
  7.   actFoto = 1
  8.   spLinea = 100
  9.   ocultarListaProgramas()
  10.   ocultarPrograma()
  11.   aFoto = the moviePath & "punto.bmp"
  12.   put aFoto
  13.   member("foto").fileName = aFoto
  14. end
  15.  
  16. on mostrarPrograma conFoto
  17.   repeat with i = 0 to 18
  18.     sprite(spPrograma + i).visible = 1
  19.   end repeat
  20.   if conFoto <> actFoto then
  21.     Dir = 1
  22.     if conFoto then
  23.       Dir = -1
  24.     end if
  25.     repeat with i = 1 to 11
  26.       sprite(spPrograma + i).locH = sprite(spPrograma + i).locH + (Dir * despFoto)
  27.       put sprite(spPrograma + i).locH
  28.     end repeat
  29.   end if
  30.   if conFoto then
  31.     sprite(spPrograma).member = "con foto"
  32.     sprite(spPrograma + 19).visible = 1
  33.   else
  34.     sprite(spPrograma).member = "sin foto"
  35.     sprite(spPrograma + 19).visible = 0
  36.   end if
  37.   actFoto = conFoto
  38.   puppetTransition(1)
  39.   updateStage()
  40.   borrarLineas()
  41. end
  42.  
  43. on ocultarPrograma
  44.   repeat with i = 0 to 19
  45.     sprite(spPrograma + i).visible = 0
  46.   end repeat
  47. end
  48.  
  49. on mostrarListaProgramas
  50.   r = sprite(spListaProgramas).rect
  51.   r = inflate(r, -2, -2)
  52.   dibujarLineas(r)
  53.   repeat with i = 0 to 5
  54.     sprite(spListaProgramas + i).visible = 1
  55.   end repeat
  56.   updateStage()
  57.   borrarLineas()
  58. end
  59.  
  60. on ocultarListaProgramas
  61.   repeat with i = 0 to 5
  62.     sprite(spListaProgramas + i).visible = 0
  63.   end repeat
  64.   ocultarPrograma()
  65. end
  66.  
  67. on currentFolder carpeta
  68.   fileList = []
  69.   ruta = the moviePath & carpeta
  70.   repeat with i = 1 to the maxinteger
  71.     n = getNthFileNameInFolder(ruta, i)
  72.     if n = EMPTY then
  73.       exit repeat
  74.     end if
  75.     append(fileList, ruta & "\" & n)
  76.   end repeat
  77.   return fileList
  78. end
  79.  
  80. on importarFotos directorio
  81.   listaFotos = []
  82.   listaFotos = currentFolder(directorio)
  83.   spRect = rect(186, 249, 452, 449)
  84.   if listaFotos <> [] then
  85.     member("foto").fileName = listaFotos[1]
  86.   end if
  87.   sprite(spPrograma + 19).rect = spRect
  88. end
  89.  
  90. on dibujarPanel spNum, rectangulo
  91.   ancho = rectangulo.right - rectangulo.left
  92.   alto = rectangulo.bottom - rectangulo.top
  93.   sprite(spNum + 5).rect = rectangulo
  94.   sprite(spNum + 6).rect = rectangulo
  95.   updateStage()
  96.   sprite(spNum).locH = rectangulo.left + 42 + 1
  97.   sprite(spNum).locV = rectangulo.bottom + 1
  98.   sprite(spNum + 1).width = ancho - 54
  99.   sprite(spNum + 1).locH = rectangulo.left + 43 + 1
  100.   sprite(spNum + 1).locV = rectangulo.bottom + 1
  101.   lineaDcha = rectangulo.left + 43 + ancho - 54
  102.   sprite(spNum + 2).locH = lineaDcha + 1
  103.   sprite(spNum + 2).locV = rectangulo.bottom + 1
  104.   sprite(spNum + 3).height = alto - 41
  105.   sprite(spNum + 3).locH = lineaDcha + 11 + 1
  106.   sprite(spNum + 3).locV = rectangulo.top + 31 + 1
  107.   sprite(spNum + 4).locH = lineaDcha + 11 + 1
  108.   sprite(spNum + 4).locV = rectangulo.top + 30 + 1
  109.   sprite(spNum + 5).rect = rectangulo
  110.   sprite(spNum + 6).rect = inflate(rectangulo, -8, 0)
  111.   sprite(spNum + 9).locH = rectangulo.right - 10
  112.   sprite(spNum + 9).locV = rectangulo.top + 10
  113.   updateStage()
  114.   borrarLineas()
  115. end
  116.  
  117. on ocultarPanel nivel
  118.   repeat with i = nivel to 4
  119.     spNum = (i * 10) + 30
  120.     repeat with j = 0 to 9
  121.       sprite(spNum + j).locH = -1000
  122.       sprite(spNum + j).locV = -1000
  123.     end repeat
  124.     sprite(spNum - 3).locH = -1000
  125.     sprite(spNum - 2).locV = -1000
  126.   end repeat
  127.   ocultarListaProgramas()
  128. end
  129.  
  130. on dibujarLineas rectangulo
  131.   ancho = rectangulo.right - rectangulo.left
  132.   alto = rectangulo.bottom - rectangulo.top
  133.   pasos = 10
  134.   d = 0.10000000000000001
  135.   dy1 = rectangulo.top * d
  136.   dy2 = alto * d
  137.   dx1 = rectangulo.left * d
  138.   dx2 = ancho * d
  139.   repeat with i = 1 to pasos
  140.     sprite(spLinea).locV = sprite(spLinea).locV + dy1
  141.     updateStage()
  142.   end repeat
  143.   sprite(spLinea).locV = rectangulo.top
  144.   sprite(spLinea + 1).locV = rectangulo.top
  145.   repeat with i = 1 to pasos
  146.     sprite(spLinea + 1).locV = sprite(spLinea + 1).locV + dy2
  147.     updateStage()
  148.   end repeat
  149.   sprite(spLinea + 1).locV = rectangulo.bottom - 1
  150.   repeat with i = 0 to pasos
  151.     sprite(spLinea + 2).locH = sprite(spLinea + 2).locH + dx1
  152.     updateStage()
  153.   end repeat
  154.   sprite(spLinea + 2).locH = rectangulo.left
  155.   sprite(spLinea + 3).locH = rectangulo.left
  156.   repeat with i = 1 to pasos
  157.     sprite(spLinea + 3).locH = sprite(spLinea + 3).locH + dx2
  158.     updateStage()
  159.   end repeat
  160. end
  161.  
  162. on borrarLineas
  163.   sprite(spLinea).locV = 0
  164.   sprite(spLinea + 1).locV = 0
  165.   sprite(spLinea + 2).locH = 0
  166.   sprite(spLinea + 3).locH = 0
  167.   updateStage()
  168. end
  169.