Suporte no desenvolvimento de jogos


    [Resolvido] Script Nome do Mapa

    avatar
    Lamina
    Iniciante
    Iniciante

    Mensagens : 75
    Créditos : 0
    Cash : 0

    [Resolvido] Script Nome do Mapa Empty [Resolvido] Script Nome do Mapa

    Mensagem por Lamina em Dom Nov 27, 2011 5:41 pm

    Já vi um script que faz aparecer um nome do mapa na tela e depois ele sai, mas nao sei onde encontra-lo!!!!
    Tentei usar um, mas o nome fica na tela, e isso gera mt lag...

    Alguem tem o script de nome do mapa?
    matheus180
    matheus180
    Desenvolvedor
    Desenvolvedor

    Mensagens : 752
    Créditos : 174
    Cash : 0

    [Resolvido] Script Nome do Mapa Empty Re: [Resolvido] Script Nome do Mapa

    Mensagem por matheus180 em Dom Nov 27, 2011 10:14 pm

    Toma ai espero que você goste, coloca uma imagem Mpname dentro da pasta picture, não tenho uma aqui agora mais funciona

    Spoiler:
    #_______________________________________________________________________________
    # MOG_Location_Name V2.3
    #_______________________________________________________________________________
    # By Moghunter
    # http://www.atelier-rgss.com
    #_______________________________________________________________________________
    # Apresenta o nome do mapa.
    # É preciso ter uma imagem com o nome de "Mpname" dentro
    # da pasta pictures.
    #_______________________________________________________________________________
    module MOG
    #Nome da fonte.
    LOCATION_FONT_NAME = "Georgia"
    #Tamanho da fonte.
    LOCATION_FONT_SIZE = 20
    #Fonte com contorno.
    LOCATION_FONT_BOLD = true
    #Fonte em italico
    LOCATION_FONT_ITALIC = true
    #Tempo de permanencia da janela.
    LOCATION_TIME = 1
    #Ativar efeito de zoom
    LOCATION_ZOOM_EFFECT = true
    #Posição horizontal da janela
    LOCATION_X = 220
    #Posição vertical da janela
    LOCATION_Y = 220
    #Posição do texto.
    LOCATION_TEXT_X = 30
    LOCATION_TEXT_Y = 10
    #ID da Swicht que desativa a janela
    LOCATION_SWITCH_OFF = 15
    end

    #==============================================================================
    # Game_Temp
    #==============================================================================
    class Game_Temp
    attr_accessor :loc_time
    attr_accessor :loc_name_x
    attr_accessor :loc_name_y
    attr_accessor :loc_name_zoom_x
    attr_accessor :loc_name_zoom_y
    attr_accessor :loc_name_opa
    attr_accessor :loc_layout_x
    attr_accessor :loc_layout_y
    attr_accessor :loc_layout_zoom_x
    attr_accessor :loc_layout_zoom_y
    attr_accessor :loc_layout_opa

    #--------------------------------------------------------------------------
    # Initialize
    #--------------------------------------------------------------------------
    alias mog_animapname_initialize initialize
    def initialize
    mog_animapname_initialize
    @loc_time = 40 * MOG::LOCATION_TIME
    @loc_name_x = 60
    @loc_name_y = 0
    @loc_name_zoom_x = 1.2
    @loc_name_zoom_y = 1.2
    @loc_name_opa = 255
    @loc_layout_x = -60
    @loc_layout_y = 0
    @loc_layout_zoom_x = 1
    @loc_layout_zoom_y = 1
    @loc_layout_opa = 255
    end
    end
    #==============================================================================
    # Game_Map
    #==============================================================================
    class Game_Map
    attr_reader :map_id

    #--------------------------------------------------------------------------
    # Mpname
    #--------------------------------------------------------------------------
    def mpname
    $mpname = load_data("Data/MapInfos.rxdata")
    $mpname[@map_id].name
    end
    end
    #==============================================================================
    # Sprite_Location
    #==============================================================================
    class Sprite_Location < Sprite
    include MOG

    #--------------------------------------------------------------------------
    # Initialize
    #--------------------------------------------------------------------------
    def initialize
    @viewport = Viewport.new(0, 0, 640, 480)
    @viewport.z = 99999
    super(@viewport)
    @layout = Sprite.new
    @layout.bitmap = RPG::Cache.picture("Mpname")
    @layout.z = 9998
    @layout.ox = -LOCATION_X + $game_temp.loc_layout_x
    @layout.oy = -LOCATION_Y + $game_temp.loc_layout_y
    @layout.opacity = $game_temp.loc_layout_opa
    @location_name = Sprite.new
    @location_name.bitmap = Bitmap.new(200,60)
    @location_name.z = 9999
    @location_name.bitmap.font.size = LOCATION_FONT_SIZE
    @location_name.bitmap.font.name = LOCATION_FONT_NAME
    @location_name.bitmap.font.bold = LOCATION_FONT_BOLD
    @location_name.bitmap.font.italic = LOCATION_FONT_BOLD
    @location_name.ox = -LOCATION_X + $game_temp.loc_name_x
    @location_name.oy = -LOCATION_Y + $game_temp.loc_name_y
    @location_name.opacity = $game_temp.loc_name_opa
    @location_name.bitmap.draw_text(30 + LOCATION_TEXT_X, 0 + LOCATION_TEXT_Y, 130, 60, $game_map.mpname.to_s,1)
    @location_anime_time = 20
    if LOCATION_ZOOM_EFFECT == true
    @location_name.zoom_x = $game_temp.loc_name_zoom_x
    @location_name.zoom_y = $game_temp.loc_name_zoom_y
    @layout.zoom_x = $game_temp.loc_layout_zoom_x
    @layout.zoom_y = $game_temp.loc_layout_zoom_y
    end
    if $game_switches[MOG::LOCATION_SWITCH_OFF] == true
    @location_name.visible = false
    @layout.visible = false
    else
    @location_name.visible = true
    @layout.visible = true
    end
    update
    end

    #--------------------------------------------------------------------------
    # Dispose
    #--------------------------------------------------------------------------
    def dispose
    if @layout != nil
    @layout.bitmap.dispose
    @layout.dispose
    @layout = nil
    end
    if @location_name != nil
    @location_name.bitmap.dispose
    @location_name.dispose
    @location_name = nil
    end
    if @viewport != nil
    @viewport.dispose
    @viewport = nil
    end
    end

    #--------------------------------------------------------------------------
    # Refresh
    #--------------------------------------------------------------------------
    def refresh
    $game_temp.loc_time = 40 * LOCATION_TIME
    $game_temp.loc_layout_opa = 255
    $game_temp.loc_name_opa = 255
    $game_temp.loc_layout_x = -60
    $game_temp.loc_name_x = 60
    $game_temp.loc_layout_opa = 0
    $game_temp.loc_name_opa = 0
    $game_temp.loc_layout_zoom_x = 1
    $game_temp.loc_layout_zoom_y = 1
    $game_temp.loc_name_zoom_x = 1.2
    $game_temp.loc_name_zoom_y = 1.2
    @location_name.bitmap.clear
    @location_name.bitmap.draw_text(30 + LOCATION_TEXT_X, 0 + LOCATION_TEXT_Y, 130, 60, $game_map.mpname.to_s,1)
    @location_anime_time = 20
    end

    #--------------------------------------------------------------------------
    # Update
    #--------------------------------------------------------------------------
    def update
    location_effect_update
    visible_update
    end

    #--------------------------------------------------------------------------
    # Visible Update
    #--------------------------------------------------------------------------
    def visible_update
    if $game_switches[MOG::LOCATION_SWITCH_OFF] == true
    @location_name.visible = false
    @layout.visible = false
    else
    @location_name.visible = true
    @layout.visible = true
    end
    end

    #--------------------------------------------------------------------------
    # Location Effect Update
    #--------------------------------------------------------------------------
    def location_effect_update
    @location_anime_time -= 1 if @location_anime_time > 0
    if @location_anime_time <= 0
    $game_temp.loc_time -= 1 if $game_temp.loc_time > 0
    end
    @layout.ox = -LOCATION_X + $game_temp.loc_layout_x
    @layout.oy = -LOCATION_Y + $game_temp.loc_layout_y
    @layout.opacity = $game_temp.loc_layout_opa
    @location_name.ox = -LOCATION_X + $game_temp.loc_name_x
    @location_name.oy = -LOCATION_Y + $game_temp.loc_name_y
    @location_name.opacity = $game_temp.loc_name_opa
    if LOCATION_ZOOM_EFFECT == true
    @location_name.zoom_x = $game_temp.loc_name_zoom_x
    @location_name.zoom_y = $game_temp.loc_name_zoom_y
    @layout.zoom_x = $game_temp.loc_layout_zoom_x
    @layout.zoom_y = $game_temp.loc_layout_zoom_y
    end
    if $game_temp.loc_name_x > 0 and
    $game_temp.loc_time > 0
    $game_temp.loc_name_x -= 3
    $game_temp.loc_layout_x += 3
    $game_temp.loc_layout_opa += 7
    $game_temp.loc_name_opa += 7
    $game_temp.loc_name_zoom_x -= 0.01
    $game_temp.loc_name_zoom_y -= 0.01
    elsif $game_temp.loc_name_x <= 0 and
    $game_temp.loc_time > 0
    $game_temp.loc_name_x = 0
    $game_temp.loc_layout_x = 0
    $game_temp.loc_layout_opa = 255
    $game_temp.loc_name_opa = 255
    $game_temp.loc_name_zoom_x = 1
    $game_temp.loc_name_zoom_y = 1
    $game_temp.loc_layout_zoom_x = 1
    $game_temp.loc_layout_zoom_y = 1
    $game_temp.loc_name_zoom_x = 1
    $game_temp.loc_name_zoom_y = 1
    end
    if $game_temp.loc_time <= 0 and
    $game_temp.loc_layout_opa > 0
    $game_temp.loc_layout_opa -= 10
    $game_temp.loc_name_opa -= 10
    if LOCATION_ZOOM_EFFECT == true
    $game_temp.loc_layout_x -= 9
    $game_temp.loc_layout_zoom_x -= 0.02
    else
    $game_temp.loc_layout_x += 3
    end
    $game_temp.loc_name_x -= 3
    end
    end
    end

    #==============================================================================
    # Scene_Map
    #==============================================================================
    class Scene_Map

    #--------------------------------------------------------------------------
    # Main
    #--------------------------------------------------------------------------
    alias location_name_main main
    def main
    @map_name = Sprite_Location.new
    location_name_main
    @map_name.dispose
    @map_name = nil
    end

    #--------------------------------------------------------------------------
    # Update
    #--------------------------------------------------------------------------
    alias location_update update
    def update
    location_update
    if @map_name != nil
    @map_name.update
    end
    end

    #--------------------------------------------------------------------------
    # Transfer Player
    #--------------------------------------------------------------------------
    alias location_name_transfer_player transfer_player
    def transfer_player
    location_name_transfer_player
    if @map_name != nil
    @map_name.refresh
    end
    end

    end

    $mog_rgss_location_name = true


    _________________
    [Resolvido] Script Nome do Mapa 3trEP
    avatar
    Lamina
    Iniciante
    Iniciante

    Mensagens : 75
    Créditos : 0
    Cash : 0

    [Resolvido] Script Nome do Mapa Empty Re: [Resolvido] Script Nome do Mapa

    Mensagem por Lamina em Dom Nov 27, 2011 10:19 pm

    resolvido, vlw ae

    Conteúdo patrocinado

    [Resolvido] Script Nome do Mapa Empty Re: [Resolvido] Script Nome do Mapa

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Sex Nov 22, 2019 2:28 am