RPG Maker Land
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

RPG Maker Land

O Novo mundo do RPG Maker!!
 
InícioPortalGaleriaÚltimas imagensProcurarRegistarEntrar
Entrar
Nome de usuário:
Senha:
Entrar automaticamente: 
:: Esqueci-me da senha
Últimos assuntos
» [RMVX] Sistema de Tempo + Spawner
crie um Slide Icon_minitimeSáb Ago 04, 2012 3:26 pm por Édipo 13

» [RMVX] Aventuur
crie um Slide Icon_minitimeSáb Ago 04, 2012 8:48 am por Édipo 13

» Blog Detonados e Downloads Massa!
crie um Slide Icon_minitimeQua Jan 25, 2012 3:25 pm por Édipo 13

» [RMVX] O Templo
crie um Slide Icon_minitimeQua Jan 11, 2012 8:11 am por Édipo 13

» [RPG Maker VX - Filme] Lara e a Caneta Cinza
crie um Slide Icon_minitimeSeg Jan 09, 2012 9:19 am por Édipo 13

» [RPG Maker VX] Mario Kart RPG - Versão NOBug
crie um Slide Icon_minitimeSáb Jan 07, 2012 11:31 am por Édipo 13

» Preciso de battler
crie um Slide Icon_minitimeDom Abr 03, 2011 3:35 pm por bigglia

» [RPG Maker VX] Pescaria 3 - O Final
crie um Slide Icon_minitimeDom Nov 21, 2010 9:20 am por Édipo 13

» [RPG Maker VX] Boy Scout
crie um Slide Icon_minitimeDom Nov 21, 2010 9:19 am por Édipo 13

Parceiros da RMLand!
crie um Slide Bannerpequenoly2

crie um Slide Newbannerreb0

crie um Slide Banner-2

crie um Slide Pronpaganda

crie um Slide Spoweredbytl5

crie um Slide 66334844kk1


Visite Também
crie um Slide Rmbbuttonch6 crie um Slide Tudsobuttongo2

crie um Slide Qquxzd

crie um Slide 35kr81e

Banner da Land
crie um Slide Banneratheronfk6

 

 crie um Slide

Ir para baixo 
AutorMensagem
Red
Aprendiz
Aprendiz
Red


Número de Mensagens : 19
Reputação :
crie um Slide Left_bar_bleue0 / 1000 / 100crie um Slide Right_bar_bleue

Alerta :
crie um Slide Left_bar_bleue0 / 1000 / 100crie um Slide Right_bar_bleue


crie um Slide Empty
MensagemAssunto: crie um Slide   crie um Slide Icon_minitimeTer Fev 10, 2009 12:44 am

Descrição
Cria um slide

Créditos
Freakboy

Fonte
rmxp.org

script

Código:

#==============================================================================
# ** Picture SlideShow
#------------------------------------------------------------------------------
# Author    Freakboy
# Version  1.0
# Date      15/09/08 (DD/MM/YYYY)
#------------------------------------------------------------------------------
# This script creates a picture slideshow (or 'coverflow') and let's the user
# press the Left or Right key on the keyboard to browse to the pictures
#
# Instructions:
# 1) Paste this script above main
# 2) call the script with:
# $scene = Scene_SlideShow(array_of_pictures)
#
# Default, the picture's are loaded from the /Panorama folder. If you want to
# import the images from the /Picture folder, call the script with:
# $scene = Scene_SlideShow(array_of_pictures, 'picture')
#
# Thanks to:
# Sephiroth Spawn for the scale_blt method
#------------------------------------------------------------------------------

# SLIDESHOW SETUP
BITMAP_WIDTH  = 200              # Width of the pictures
BITMAP_HEIGHT = 200              # Height of the pictures
BITMAP_X = BITMAP_WIDTH * 0.75    # X-axis spacing between each picture
BITMAP_Y = 10                    # Y-axis spacing
SCROLL_LEFT_KEY  = Input::LEFT    # Define left scrolling key
SCROLL_RIGHT_KEY = Input::RIGHT  # Define right scrolling key
# Thank you sephiroth spawn for this method!
class Bitmap
  #--------------------------------------------------------------------------
  # * Scale Blt
  #--------------------------------------------------------------------------
  def scale_blt(dest_rect, src_bitmap, src_rect =
    Rect.new(0, 0, src_bitmap.width, src_bitmap.height), opacity = 255)
   
    w, h = src_rect.width, src_rect.height
    scale = [w / dest_rect.width.to_f, h / dest_rect.height.to_f].max
    ow, oh = (w / scale).to_i, (h / scale).to_i
    ox, oy = (dest_rect.width - ow) / 2, (dest_rect.height - oh) / 2
    stretch_blt(Rect.new(ox + dest_rect.x, oy + dest_rect.y, ow, oh),
      src_bitmap, src_rect )
  end
end


#==============================================================================
# ** Scene_SlideShow
#------------------------------------------------------------------------------
#  This class performs slideshow processing
#==============================================================================

class Scene_SlideShow
  #--------------------------------------------------------------------------
  # * Initialize
  # images : Array of Pictures
  #--------------------------------------------------------------------------
  def initialize(images, folder='panorama')
    # Initialize the images, make sure it's an array
    @images = images
    @folder = folder
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Setup indexing and scrolling variables
    setup_variables()
    # Setup the pictures
    setup_pictures()
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of content
    dispose_pictures()
  end
  #--------------------------------------------------------------------------
  # * Setup Pictures
  #--------------------------------------------------------------------------
  def setup_pictures()
    # Initialize a Viewport
    @viewport = Viewport.new(0, 0, 640, 480)
    # Create an Array of Sprites
    @sprites = [ ]
    # Select each image and give a bitmap
    for image in @images
      s = Sprite.new(@viewport)
      # If the folder is 'panorama'
      if (@folder == 'panorama')
        # Import the image from the /Panorama folder
        img  = RPG::Cache.panorama(image, 0)
      # If the folder is 'picture'
      elsif (@folder == 'picture')
        # Import the image from the /Picture folder
        img  = RPG::Cache.picture(image, 0)
      else # Otherwise import the image from the /Picture folder
        img  = RPG::Cache.picture(image, 0)
      end
      # Define a rect for the bitmap
      rect = Rect.new(0, 0, BITMAP_WIDTH, BITMAP_HEIGHT)
      s.bitmap = Bitmap.new(BITMAP_WIDTH, BITMAP_HEIGHT)
      # Scale the bitmap to the defined Width and Height
      s.bitmap.scale_blt(rect, img)
      # Put the image in an array
      @sprites.push(s)
    end
    # Update the sprites X, Y and Z location
    update_sprites()
  end
 
  #--------------------------------------------------------------------------
  # * Setup Variables
  #--------------------------------------------------------------------------
  def setup_variables
    # Setup indexing variables
    @index = 0.0.to_f
    @dest_index = 0.0.to_f
    # Setup scrolling variables
    @scrolling = false
    @scroll_direction = 0
    @scroll_frames = 0
  end
 
  #--------------------------------------------------------------------------
  # * Dispose Pictures
  #--------------------------------------------------------------------------
  def dispose_pictures()
    # Dispose of all sprites
    for sprite in @sprites
      sprite.dispose
    end
  end
 
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If the pictures are scrolling
    if (@scrolling)
      # If the pictures scroll left
      if (@scroll_direction == 4)
        # Update Scroll Left
        update_scroll_left()
        return
      end
      # If the pictures scroll right
      if (@scroll_direction == 6)
        # Update Scroll Right
        update_scroll_right()
        return
      end
    end

    # If you hit the 'x' or the 'esc' button, leave the slideshow and...
    if Input.trigger?(Input::B)
      # return to the map
      $scene = Scene_Map.new
      return
    end

    # If press LEFT and index is smaller then amount of sprites - 1
    if (Input.trigger?(SCROLL_LEFT_KEY) && @index < @sprites.size - 1)
      # Scroll to left
      @scrolling = true
      @scroll_direction = 4
      @dest_index = @index + 1
      return
    end
   
    # If press RIGHT and index is greater then 0
    if (Input.trigger?(SCROLL_RIGHT_KEY) && @index > 0)
      # Scroll to right
      @scrolling = true
      @scroll_direction = 6
      @dest_index = @index - 1
      return
    end
  end
 
  #--------------------------------------------------------------------------
  # * Update Sprites
  #--------------------------------------------------------------------------
  def update_sprites()
    # Update the sprites X, Y and Z location
    for i in 0...@sprites.size
      center_x = 640 / 2 - (BITMAP_WIDTH / 2)
      center_y = 480 / 2 - (BITMAP_HEIGHT / 2)
      @sprites[i].x = center_x - ((@index.to_f - i) * BITMAP_X)
      @sprites[i].y = center_y - ((@index.to_f - i).abs * BITMAP_Y) - 50
      @sprites[i].z = 100 - ((@index - i).abs * 20)
    end
  end
 
  #--------------------------------------------------------------------------
  # * Update Scroll Left
  #--------------------------------------------------------------------------
  def update_scroll_left
    # Raise the index slowly
    @index += 0.125.to_f
    # Update the sprite positions
    update_sprites()
    # If the index is equal to the dest index
    if (@dest_index == @index)
      # Stop scrolling
      @scrolling = false
      return
    end
  end
 
  #--------------------------------------------------------------------------
  # * Update Scroll Right
  #--------------------------------------------------------------------------
  def update_scroll_right
    # Lower the index slowly
    @index -= 0.125.to_f
    # Update the sprite positions
    update_sprites()
    # If the index is equal to the dest index
    if (@dest_index == @index)
      # Stop scrolling
      @scrolling = false
      return
    end
  end
end

Instruções

A) cole o script antes do main

B) Crie esse evento para chamar o script

images = ["001-Sky01", "002-Sky02", "003-StarlitSky01", "004-CloudySky01",
"005-Sunset01", "006-Mountains01", "007-Ocean01"
]
$scene = Scene_SlideShow.new(images, 'panorama')



Para mudar as imagens
importe as imagens que vc quer usar para pasta picture

troque o que está entre " " no evento, pelo nome das suas imagens

Exemplo

images = ["sua imagem",
Ir para o topo Ir para baixo
 
crie um Slide
Ir para o topo 
Página 1 de 1
 Tópicos semelhantes
-
» crie um jogo Tetris

Permissões neste sub-fórumNão podes responder a tópicos
RPG Maker Land :: RGSS :: Scripts XP-
Ir para: