Ir a contenido

0

Insertar video


4 las respuestas a este tema

#1 edugonrod

    Paladin

  • voidzonero
  • 172 Mensajes:
  • Genero:Chico
  • Nivel maker: Crack
  • Especialidad: Musico

Publicado el 03 September 2006 - 05:05 AM

Tienes que crear un nuevo script justo encima de la clase Main :

CODE

Code:

#==============================================================================
# ? MoviePlayer Module v0.5
#------------------------------------------------------------------------------
# By: dgam3z
# Date: 18/10/04
#==============================================================================

module MoviePlayer

#--------------------------------------------------------------------------
# ? The attr_acessor for those pretty functions this mod has.
#-------------------------------------------------------------------------
class<<self
attr_accessor(:X,:y,:z,:width,:height,:opacity)
end

#--------------------------------------------------------------------------
# ? Initialize the constants.
#-------------------------------------------------------------------------
MULTIFILE = 1
ONEFILE = 2

#--------------------------------------------------------------------------
# ? Initialize.
#-------------------------------------------------------------------------

@loaded = false

#--------------------------------------------------------------------------
# ? Loads the file(s).
# In: name, frames, @loaded
# Out: @rmm_name, @rmm_type, @rmm_width, @rmm_height, @loaded, @rmm_frames
#-------------------------------------------------------------------------
def self.load(name,frames=0)
if not @loaded then
#Checks if the movie is ONEFILE.
if FileTest.exists?("Movies/"+name+".png") then
if frames != 0
@rmm_frames = frames
else
if $DEBUG then print "Debug: Number of frames needed for this movie." end
return 3 #Error 3: Need the number of frames.
end

@rmm = Sprite.new
@rmm_name = name
@rmm_type = ONEFILE
@rmm_x = 0
@rmm_y = 0
@rmm_z = 4000
@rmm_width = 0
@rmm_height = 0
@frame_counter = 0

#Checks the size of the file.
@rmm_width = Bitmap.new("Movies/"[email protected]_name+".png").width/@rmm_frames
@rmm_height = Bitmap.new("Movies/"[email protected]_name+".png").height
@loaded = true
return 0 #No Errors: Everything wen't fine.
end
#Checks if the movie is MULTIFILE.
if FileTest.exists?("Movies/"+name+"/"+name+"_0.png") then

@rmm = Sprite.new
@rmm_name = name
@rmm_type = MULTIFILE
@rmm_frames = 0
@rmm_x = 0
@rmm_y = 0
@rmm_z = 4000
@rmm_width = 0
@rmm_height = 0
@frame_counter = 0

#Checks the size of the file.
@rmm_width = Bitmap.new("Movies/"[email protected]_name+"/"[email protected]_name+"_0.png").width
@rmm_height = Bitmap.new("Movies/"[email protected]_name+"/"[email protected]_name+"_0.png").height

i = 0
while FileTest.exist?("Movies/"[email protected]_name+"/"[email protected]_name+"_#{i}.png")
i = i + 1
end
#And get the number of frames.
@rmm_frames = i - 1
@loaded = true
return 0 #No Errors: Everything wen't fine.
end
if $DEBUG then print "Debug: File not found." end
return 2 #Error 2: File not found.
end
if $DEBUG then print "Debug: Last movie not unloaded." end
return 1 #Error 1: Needs to unload last movie first.
end

#--------------------------------------------------------------------------
# ? Starts a movie.
#-------------------------------------------------------------------------
def self.start(trans=40)
if not @loaded then
if $DEBUG then print "Debug: Can't start, movie not loaded." end
return 1 #Error 1: Not loaded.
end

Graphics.freeze

if @rmm_type == ONEFILE then
@rmm.bitmap = Bitmap.new("Movies/"[email protected]_name+".png")
@rmm.src_rect.set(@rmm_width*@frame_counter, 0, @rmm_width, @rmm_height)
end

if @rmm_type == MULTIFILE then
@rmm.bitmap = Bitmap.new("Movies/"[email protected]_name+"/"[email protected]_name+"_0.png")
@rmm.src_rect.set(0, 0, @rmm.bitmap.width, @rmm.bitmap.height)
end

@frame_counter = 1

#Makes the transition.
Graphics.transition(trans)
end

#--------------------------------------------------------------------------
# ? Updates the movie. (changes to the next frame)
#-------------------------------------------------------------------------
def self.update
if @loaded == true then
if @rmm_type == ONEFILE then
@rmm.src_rect.set(@rmm_width*@frame_counter, 0, @rmm_width, @rmm_height)
end
if @rmm_type == MULTIFILE then
@rmm.bitmap = Bitmap.new("Movies/"[email protected]_name+"/"[email protected]_name+"_#{@frame_counter}.png")
@rmm.src_rect.set(0, 0, @rmm.bitmap.width, @rmm.bitmap.height)
end
Graphics.update
@frame_counter = @frame_counter + 1
if @frame_counter == @rmm_frames
@frame_counter = 0
return true
else
return false
end
end
end


#--------------------------------------------------------------------------
# ? Sets and retrieves the movie coordinates.
#-------------------------------------------------------------------------
def self.x; return @rmm.x; end
def self.x=(tx); @rmm.x = tx; end
def self.y; return @rmm.y; end
def self.y=(ty); @rmm.y = ty; end
def self.z; return @rmm.z; end
def self.z=(tz); @rmm.z = tz; end

#--------------------------------------------------------------------------
# ? Retrieves the movie size.
#-------------------------------------------------------------------------
def self.width; return @rmm_width; end
def self.height; return @rmm_height; end

#--------------------------------------------------------------------------
# ? Sets and retrieves the movie opacity.
#-------------------------------------------------------------------------
def self.opacity; return @rmm.opacity; end
def self.opacity=(topacity); @rmm.opacity = topacity; end

#--------------------------------------------------------------------------
# ? Checks if a movie is loaded.
#-------------------------------------------------------------------------
def self.loaded?
return @loaded
end

#--------------------------------------------------------------------------
# ? Returns the in which frame is the movie now.
#-------------------------------------------------------------------------
def self.frame?
if @loaded then
return @frame_counter
end
end

#--------------------------------------------------------------------------
# ? Easy Definition to play movies (aka Newbie Definition).
#-------------------------------------------------------------------------
def self.play(movie, loops=1, wait=2, trans=0, x=nil, y=nil, z=4000, opacity=255)
MoviePlayer.load(movie)
if x != nil then MoviePlayer.x = x; else MoviePlayer.x = 320 - @rmm_width/2; end
if y != nil then MoviePlayer.y = y; else MoviePlayer.y = 240 - @rmm_height/2; end
MoviePlayer.z = z
MoviePlayer.start(trans)
for i in 1..loops
begin
for i in 0..wait
Graphics.update
end
end while MoviePlayer.update == false
end
MoviePlayer.stop(trans)
end

#--------------------------------------------------------------------------
# ? Stops and unloads the movie.
#-------------------------------------------------------------------------
def self.stop(trans=40)
if not @loaded then
if $DEBUG then print "Debug: Can't stop, movie not loaded." end
return 1 #Error 1: Not loaded.
end

Graphics.freeze

@rmm.bitmap.dispose

@loaded = false

#Makes the transition.
Graphics.transition(trans)
end
end



Como usarlo
Para la gente que no conoce nada sobre rgss y quiere poner una animación, esta definición.

Code:

MoviePlayer.play(movie, loops, wait, trans, x, y, z, opacity)



> movie: The file to play, must be inside the "movies" directory.
> loops: How many times you want to play the animation. Default: 1
> wait: The number of dummy frames to wait between frames. Default: 2
> trans: The frames that the transition before and after the animation takes. Default: 40
> x,y,z: The location of the animation on the screen. Default: Center on the screen and z=4000
> opacity: The opacity of the animation.

Then there is those advanced definitions and properties. Después aqui están las propiedades y las definiciones avanzadas.
MoviePlayer.load(movie, frames)
Loads the movie. "movie" is the movie to load and "frames" is the number of frames that the movie has, "frames" can only be used by those animation on one file. There are plenty of returns on this definition for each error, please check the comments.
MoviePlayer.start(trans)
Here the movie starts, "trans" is the frames that the transition takes.
MoviePlayer.update
This updates the movie to next frame, returns "true" when reaches the last frame.
MoviePlayer.stop(trans)
This makes the movie stop, "trans" is the frames that the transition takes.

MoviePlayer.x and MoviePlayer.y and MoviePlayer.z
These properties sets the movie coordinates on the screen, this can be changed while the animation is playing.

MoviePlayer.width and MoviePlayer.height
Read only properties that return the size of the animation.

MoviePlayer.frame?
Returns in which frame is the animation.

MoviePlayer.loaded?
Returns true if a movie is loaded






Lo poco que hay traducido lo tradujo Pickspy

#2 Soramar0

    StarFolk

  • Moderador Power!
  • 1,033 Mensajes:
  • Location:Venezuela
  • Interests:El Futboll, El anime genero Seinem, joder con la gente.
  • Genero:Chico
  • Nivel maker: Experto
  • Especialidad: Scripting

Publicado el 03 September 2006 - 08:37 AM

nunca e podido usar este script siempre me da error llorar.gif

#3 Aluculef

    Heroe errante

  • Members
  • 35 Mensajes:
  • Genero:Chico
  • Nivel maker: Experto

Publicado el 18 November 2006 - 12:12 PM

nuca e podido usar este script nunca se como iniciarlo icon4.gif

#4 Guest_sabin_*

  • Guests

Publicado el 18 November 2006 - 12:21 PM

Hey deja de responder a temas viejos que llevan mas de un mes cabreado.gif
avusas de tu poder cabreado.gif

Editado por sabin, 19 November 2006 - 05:14 AM.


#5 xXDarkDragonXx

    Lost in Ethereal Reverie

  • Moderador Power!
  • 1,505 Mensajes:
  • Location:America 4ever! lol Mucho sarcasmo...
  • Interests:Jugar Castlevania: Symphony of the Night, salir al cine, escuchar Rock, la Ley del Vago
  • Genero:Chico
  • Nivel maker: Experto
  • Especialidad: Mapeo

Publicado el 18 November 2006 - 01:07 PM

Y ahora te digo yo sabin, deja de pseudomoderar sino vas a opinar del tema. ya yo le avise por PM hace horas. Te llevas warn por pseudomoderar y no escribir nada relacionado al tema. Tu te lo "buscaste" que te lo suba.