Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Por markef
- os.cpu(333)
- -- Carga modelo
- galeria = model.load("modelo/galeria.obj",0.001,black)
- -- Carga imagenes
- imagen={}
- for i = 1, 9 do
- imagen[i] = image.load("tusimagenes/imagen"..i..".png")
- end
- sombras = image.load("imagenes/sombras.png")
- fp1 = image.load("imagenes/fp1.png")
- fp2 = image.load("imagenes/fp2.png")
- fp3 = image.load("imagenes/fp3.png")
- fp4 = image.load("imagenes/fp4.png")
- --Luces
- world.lighttype(1,2)
- world.lightcomponent(1,1)
- world.lightambient(1,color.new(255,255,255))
- world.lightposition(2,0,0,-100)
- world.lightenabled(1,true)
- world.lightattenuation(1,0,0,0.0000005)
- world.lights(true)
- world.ambient(color.new(0,0,0))
- world.specular(5)
- world.update()
- -- Funcion splash
- function splash(im,te,vel)
- local img = image.load(im)
- local cont = timer.new()
- te = te or 100
- vel = vel or 1
- for i = 0, 100, vel do
- img:blend(0,0,i)
- screen.flip()
- end
- cont:start()
- while cont:time() < te do end
- for i = 200, 0, -vel do
- img:blend(0,0,i)
- screen.flip()
- end
- img:free()
- end
- -- Muestra splash
- splash("imagenes/splashmarkef.png",200,1)
- -- Colores
- white = color.new(255,255,255)
- black = color.new(0,0,0)
- red = color.new(255,0,0)
- -- Valores
- ejeY = 0
- ejeYi = 0
- i = 1
- triangle_pressed = false
- cross_pressed = false
- circle_pressed = false
- square_pressed = false
- --While
- while (true) do
- -- Modelo galeria
- galeria:position(0,ejeY,0.2)
- galeria:rotation(0,0,0)
- -- Lectura controles
- controls.read()
- -- Controles
- if controls.press("r") then
- tmp = screen.toimage()
- tmp :save ("ms0:/PSP/GAME/galeriamarkef/capturas/captura"..i..".png")
- i = i + 1
- end
- -- Fondo
- fp1:blit(0,0)
- -- Si pulsamos unos controles desplaza la galeria
- if controls.up() then ejeY = ejeY - 0.01 ejeYi = ejeYi - 2.5 end
- if controls.down() then ejeY = ejeY + 0.01 ejeYi = ejeYi + 2.5 end
- -- Pero si se pulsa otros se cambia el fondo
- if triangle_pressed then fp1:blit(0,0) end
- if controls.press("triangle") then triangle_pressed = not triangle_pressed end
- if cross_pressed then fp2:blit(0,0) end
- if controls.press("cross") then cross_pressed = not cross_pressed end
- if square_pressed then fp3:blit(0,0) end
- if controls.press("square") then square_pressed = not square_pressed end
- if circle_pressed then fp4:blit(0,0) end
- if controls.press("circle") then circle_pressed = not circle_pressed end
- -- Muestra galeria
- galeria:blit()
- -- Reescala las imagenes de los lados
- for i = 0, 6,3 do
- imagen[i+1]:resize(80,89)
- imagen[i+2]:resize(90,89)
- imagen[i+3]:resize(80,89)
- if i == 0 then
- imagen[i+1]:blit(45.5,95 - ejeYi)
- imagen[i+2]:blit(196,95.5 - ejeYi)
- imagen[i+3]:blit(357.5,95 - ejeYi)
- elseif i == 3 then
- imagen[i+1]:blit(45.5,322 - ejeYi)
- imagen[i+2]:blit(196,322.5 - ejeYi)
- imagen[i+3]:blit(357.5,322 - ejeYi)
- elseif i == 6 then
- imagen[i+1]:blit(45.5,544 - ejeYi)
- imagen[i+2]:blit(196,544.5 - ejeYi)
- imagen[i+3]:blit(357.5,544 - ejeYi)
- end
- end
- --
- sombras:blit(0,0 - ejeYi)
- --
- sombras:blit(0,222 - ejeYi)
- --
- sombras:blit(0,450 - ejeYi)
- -- Print
- screen.print(175,30,"GALERÍA DE "..os.nick(),0.6,white,black)
- screen.print(147,40,"FECHA: "..os.date(),0.5,red,black)
- -- Muestra en el screen
- screen.flip()
- -- Finaliza
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement