Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

800x600 transition on TItle Screen

hey guys, i finaly found the resolution script i used on past (made by Selwyn), but im not sure if this an outdate version or not, anyways, i'm using this:

Code:
 

#==============================================================================

# ■ Resolution

#------------------------------------------------------------------------------

#  created by Selwyn

#  selwyn@rmxp.ch

#

#  released on the 19th of June 2006

#

#  allows to change the game window's resolution to 800 by 600.

#==============================================================================

 

module Resolution

  #--------------------------------------------------------------------------

  # ● instance variables

  #--------------------------------------------------------------------------

  attr_reader :state

  #--------------------------------------------------------------------------

  # ● initialize

  #--------------------------------------------------------------------------

  def initialize

    title = "\0" * 256

    Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L').call("Game", "Title", "", title, 256, ".\\Game.ini")

    title.delete!("\0")

    @set_resolution  = Win32API.new('Display.dll', 'SetResolution', 'III', 'I')

    @set_window_long = Win32API.new('user32', 'SetWindowLong', 'LIL', 'L')

    @set_window_pos  = Win32API.new('user32', 'SetWindowPos', 'LLIIIII', 'I')

    @gsm             = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')

    @gcr             = Win32API.new('user32', 'GetClientRect', 'LP', 'I')

    @kbe             = Win32API.new('user32', 'keybd_event', 'LLLL', '')

    @gaks            = Win32API.new('user32', 'GetAsyncKeyState', 'L', 'I')

    @window = Win32API.new('user32', 'FindWindow', 'PP', 'I').call("RGSS Player", title)

    @default_size = size

    if size[0] < 800 or size[1] < 600

      print("A minimum screen resolution of [800 by 600] is required in order to play #{title}")

      exit

    end

    @state = "default"

    self.default

  end

  #--------------------------------------------------------------------------

  # ● fullscreen

  #--------------------------------------------------------------------------

  def fullscreen

    @default_size = size

    @set_window_long.call(@window, -16, 0x14000000)

    @set_window_pos.call(@window, -1, 0, 0, 802, 602, 64)

    @set_resolution.call(800, 600, 4)

    @state = "fullscreen"

  end

  #--------------------------------------------------------------------------

  # ● default

  #--------------------------------------------------------------------------

  def default

    x = @default_size[0] / 2 - 403

    y = @default_size[1] / 2 - 316

    @set_window_long.call(@window, -16, 0x14CA0000)

    @set_window_pos.call(@window, 0, x, y, 808, 627, 0)

    @set_resolution.call(@default_size[0], @default_size[1], 0)

    @state = "default"

  end

  #--------------------------------------------------------------------------

  # ● trigger?(key)

  #--------------------------------------------------------------------------

  def trigger?(key)

    return @gaks.call(key) & 0x01 == 1

  end

  #--------------------------------------------------------------------------

  # ● private

  #--------------------------------------------------------------------------

  private :fullscreen

  private :default

  private :trigger?

  #--------------------------------------------------------------------------

  # ● size

  #--------------------------------------------------------------------------

  def size

    width = @gsm.call(0)

    height = @gsm.call(1)

    return width, height

  end

  #--------------------------------------------------------------------------

  # ● change

  #--------------------------------------------------------------------------

  def change

    if @state == "default"

      self.fullscreen

    else

      self.default

    end

  end

  #--------------------------------------------------------------------------

  # ● update

  #--------------------------------------------------------------------------

  def update

    if trigger?(121) # F10

      self.change

    end

    if Input.trigger?(Input::ALT) or Input.press?(Input::ALT)

      @kbe.call(18, 0, 2, 0)

    end

  end

  #--------------------------------------------------------------------------

  # ● module functions

  #--------------------------------------------------------------------------

  module_function :initialize

  module_function :fullscreen

  module_function :default

  module_function :trigger?

  module_function :size

  module_function :change

  module_function :update

end

 

and using:
Resolution.initialize
Resolution.fullscreen

before the 'Begin' on Main script

(new users, keep in mind this script requires: Display.dll, so dont bother copy&paste without it :) )

i got an automatic 800x600 full screen resolution everywhere, i changed ALL viewports i found to match the new size, modified spriteset map for viewports start on 30, 30, 640, 480 (using a HUD to hide the 'black' spots), and last time I was around i stil remember wasn't possibl to make the Map transitions higher then 640x480 by some hardcoded script limitation, but i remember i had made myself a animated title screan (and dont remember how it looked exactly :P), but my question now is:

is there currently a way to allow Transition effects affect the fullscrean while on Title/Game OVer areas in 800x600, or am i using a outdated script without that support

thanks

PS: i think i posted this on right section, since im not 'requesting' a script, just requesting info about if theres already a sollution to the issue or not :)
 
The problem is actually how they programmed the transitions. Specifically, the transitions were programmed with the set window size of 640x480, with no means to compensate for variable sizing. In other words, without programming a custom transition, you're stuck with no functional transitions. (Which I have done, only to find it exceedingly slow. Plus, I never figured out how to add in the vague value, to make it fade instead of simply having a sharp edge)
 

Arnon

Member

Try these two scripts together:

Code:
#==============================================================================

# ** Graphics Module Modification (part 1)

#------------------------------------------------------------------------------

#  Script for support of the bigger transition graphic.

#==============================================================================

# ■ Graphics.snap_to_bitmap (version 2, optimized)

#    Author: 神思

#    Optimization by: AAM@_@

#    Translation by: Arnon (20.12.2009)

#    dragonsigh@gmail.com

#==============================================================================

#==============================================================================

# ■ Graphics

#------------------------------------------------------------------------------

#  Graphics processing module modification:

#   RMXP + Graphics.snap_to_bitmap

#==============================================================================

 

class << Graphics

 

 CreateDC = Win32API.new("gdi32", "CreateDC", "pppl", "l")

 CreateCompatibleBitmap = Win32API.new("gdi32", "CreateCompatibleBitmap", "lll", "l")

 CreateCompatibleDC = Win32API.new("gdi32", "CreateCompatibleDC", "l", "l")

 SelectObject = Win32API.new("gdi32", "SelectObject", "ll", "l")

 BitBlt = Win32API.new("gdi32", "BitBlt", "lllllllll", "l")

 GetBitmapBits = Win32API.new("gdi32", "GetBitmapBits", "llp", "l")

 ScreenToClient = Win32API.new("user32", "ScreenToClient", "ip", "i")

 DeleteDC = Win32API.new("gdi32", "DeleteDC", "l", "l")

 DeleteObject = Win32API.new("gdi32", "DeleteObject", "l", "l")

 SRCCOPY = 0xCC0020

 RtlMoveMemory = Win32API.new('kernel32', 'RtlMoveMemory', 'ipi', 'i')

 HWnd = Win32API.new("user32", "GetActiveWindow", nil, 'l').call

 DwCount = (800 * 600 * 4) * 2

 @@lpBits = "\000" * DwCount

 #--------------------------------------------------------------------------

 # ● snap_to_bitmap

 #   Converting image from screen to Bitmap object.

 #--------------------------------------------------------------------------

 def snap_to_bitmap

   width, height = 800,600

   hb = Bitmap.new(width, height)

   rgbs = self.bitmap_data

   len = width * 4

   for y in 0...height

     break if 2*y >= height - 1

     nth1 = y * len

     nth2 = (height - 1 - y) * len

     tStr = rgbs[nth1,len]

     rgbs[nth1, len] = rgbs[nth2, len]

     rgbs[nth2, len] = tStr

   end

   RtlMoveMemory.call(hb.address, rgbs, 800 * 600 * 4)

   return hb

 end

 #--------------------------------------------------------------------------

 # ● bitmap_data

 #   Get the current data from the screen.

 #--------------------------------------------------------------------------

 def bitmap_data

   hScrDC = CreateDC.call("DISPLAY", "", "", 0)

   hMemDC = CreateCompatibleDC.call(hScrDC)

   hBitmap = CreateCompatibleBitmap.call(hScrDC, 800, 600)

   hOldBitmap = SelectObject.call(hMemDC, hBitmap)

   BitBlt.call(hMemDC, xsrc, ysrc, 800*2, 600*2, hScrDC, 0, 0, SRCCOPY)

   hBitmap2 = SelectObject.call(hMemDC, hOldBitmap)

   GetBitmapBits.call(hBitmap2, DwCount, @@lpBits)

   DeleteDC.call(hScrDC)

   DeleteDC.call(hMemDC)

   DeleteObject.call(hBitmap)

   DeleteObject.call(hOldBitmap)

   DeleteObject.call(hBitmap2)

   return @@lpBits

 end

 #--------------------------------------------------------------------------

 # ● Window Location X

 #--------------------------------------------------------------------------

 def xsrc

   return self.point[0]

 end

 #--------------------------------------------------------------------------

 # ● Window Location Y

 #--------------------------------------------------------------------------

 def ysrc

   return self.point[1]

 end

 #--------------------------------------------------------------------------

 # ● Point Recognition

 #--------------------------------------------------------------------------

 def point

   point = [0,0].pack("LL")

   ScreenToClient.call(HWnd, point)

   return point.unpack("LL")

 end

end

#==============================================================================

# ■ Bitmap

#------------------------------------------------------------------------------

#  Image processing class.

#==============================================================================

 

class Bitmap

 RtlMoveMemory = Win32API.new('kernel32', 'RtlMoveMemory', 'pii', 'i')

 #--------------------------------------------------------------------------

 # ● 

 #--------------------------------------------------------------------------

 def address

   # [[[bitmap.object_id * 2 + 16] + 8] + 16] == the beginning of the data

   buffer, ad = "xxxx", object_id * 2 + 16

   RtlMoveMemory.call(buffer, ad, 4)

   ad = buffer.unpack("L")[0] + 8

   RtlMoveMemory.call(buffer, ad, 4)

   ad = buffer.unpack("L")[0] + 16

   RtlMoveMemory.call(buffer, ad, 4)

   return buffer.unpack("L")[0]

 end

end
Code:
#==============================================================================

# ** Graphics Module Modification (part 2)

#------------------------------------------------------------------------------

#  Script for support of the bigger transition graphic.

#==============================================================================

# Author: hide秀

# Modification: Arnon (15.01.2010)

# [email=dragonsigh@gmail.com]dragonsigh@gmail.com[/email]

#==============================================================================

 

module Graphics

  

  @@vt = Viewport.new(0,0,800,600)

  @@vt.z = 9999999

  

  @@freezed = false

  @@st = nil

  @@bt = Bitmap.new(@@vt.rect.width,@@vt.rect.height)

  @@bt.fill_rect(@@bt.rect,Color.new(0,0,0,255))

 

  module_function

  

  def transition(frame_count = 8,filename = "")

    @@freezed = false

    value = (255.to_f / frame_count)

 

    if filename == ""

      @@st = Sprite.new(@@vt)

      #@@st.bitmap = @@bt

      @@st.bitmap = Graphics.snap_to_bitmap

      pls = 0

      for i in 0...frame_count

        pls += value

        @@st.opacity = 255 - pls

        self.update

      end

      @@st.dispose

      @@st = nil

      return

    end

 

    mask_sp = Sprite.new(@@vt)

    mask_bi = Bitmap.new(filename)

    mask_sp.bitmap = mask_bi

    mask_sp.z = @@st.z + 1 if @@st != nil

    mask_sp.blend_type = 2

 

    pls = 0

    for i in 0...frame_count

      pls += value

      mask_sp.opacity = 255 - pls

      @@bt.fill_rect(@@bt.rect,Color.new(pls,pls,pls,255 - pls))

      self.update

    end

 

    mask_bi.dispose

    mask_sp.dispose

 

    @@st.dispose if @@st != nil

    @@st = nil

  end

 

  def freeze

    return if @@freezed

    @@freezed = true

    #@@st = Sprite.new(@@vt)

    #@@st.bitmap = @@bt

  end

   

end

and don't forget to increase the size of transition graphics files up to 800x600.
 
thank you for your help, but that didnt worked the way I wanted, but i remembered how i did it on past =)

i 'cheat' the game and force it to load 4 sprites in the 4 corners and it looks just like 1 only effect :)

this what im using right now:

Code:
 

#==============================================================================

# Scene_Title

#------------------------------------------------------------------------------

# Esta classe trata da Tela de Título

# Modificação temporaria por: 2R (02/07/2010)

# Falta alterar a window, adicionar mais efeitos e adicionar mais 2 comandos

#==============================================================================

 

class Scene_Title

  

  #--------------------------------------------------------------------------

  # Processamento Principal

  #--------------------------------------------------------------------------

  

  def main

    # Se estiver em Teste de Batalha

    if $BTEST

      battle_test

      return

    end

    # Carregar o Banco de Dados

    $data_actors        = load_data("Data/Actors.rxdata")

    $data_classes       = load_data("Data/Classes.rxdata")

    $data_skills        = load_data("Data/Skills.rxdata")

    $data_items         = load_data("Data/Items.rxdata")

    $data_weapons       = load_data("Data/Weapons.rxdata")

    $data_armors        = load_data("Data/Armors.rxdata")

    $data_enemies       = load_data("Data/Enemies.rxdata")

    $data_troops        = load_data("Data/Troops.rxdata")

    $data_states        = load_data("Data/States.rxdata")

    $data_animations    = load_data("Data/Animations.rxdata")

    $data_tilesets      = load_data("Data/Tilesets.rxdata")

    $data_common_events = load_data("Data/CommonEvents.rxdata")

    $data_system        = load_data("Data/System.rxdata")

    # Criar um Sistema

    $game_system = Game_System.new

    # Criar um gráfico de título

    @sprite = Sprite.new

    @sprite.bitmap = RPG::Cache.title("title")

    # Crio fog nos 4 cantos do ecrã

    @viewportc1 = Viewport.new(0, 0, 400, 300)

    @viewportc2 = Viewport.new(0, 300, 400, 300)

    @viewportc3 = Viewport.new(400, 0, 400, 300)

    @viewportc4 = Viewport.new(400, 300, 400, 300)

    # As sprites que abem o fog, que cria o efeito de ilusão de um so

    @spritec1 = Plane.new(@viewportc1)

    @spritec1.bitmap = RPG::Cache.title("title-trans")

    @spritec1.opacity = 50

    @spritec2 = Plane.new(@viewportc2)

    @spritec2.bitmap = RPG::Cache.title("title-trans")

    @spritec2.opacity = 50

    @spritec3 = Plane.new(@viewportc3)

    @spritec3.bitmap = RPG::Cache.title("title-trans")

    @spritec3.opacity = 50

    @spritec4 = Plane.new(@viewportc4)

    @spritec4.bitmap = RPG::Cache.title("title-trans")

    @spritec4.opacity = 50

    # Criar uma janela de comandos

    s1 = "Novo Jogo"

    s2 = "Continuar"

    s3 = "Sair"

    @command_window = Window_Command.new(192, [s1, s2, s3])

    @command_window.back_opacity = 160

    @command_window.x = 320 - @command_window.width / 2

    @command_window.y = 288

    # O comando Continuar (s2) tem uma determinante

    # Aqui é checado se existe algum arquivo de save

    # Se estiver habilitado, tornar @continue_enabled verdadeiro; se estiver 

    # desabilitado, tornar falso

    @continue_enabled = false

    for i in 0..3

      if FileTest.exist?("Save#{i+1}.rxdata")

        @continue_enabled = true

      end

    end

    # Se Continuar estiver habilitado, mover o cursor para "Continuar"

    # Se estiver desabilitado, o texto será mostrado em cinza

    if @continue_enabled

      @command_window.index = 1

    else

      @command_window.disable_item(1)

    end

    # Reproduzir BGM de Título

    $game_system.bgm_play($data_system.title_bgm)

    # Parar de reproduzir BGS e ME

    Audio.me_stop

    Audio.bgs_stop

    # Executar transição

    Graphics.transition

    # Loop principal

    loop do

      # Atualizar a tela de jogo

      Graphics.update

      # Atualizar a entrada de informações

      Input.update

      # Atualizar o frame

      update

      # Abortar o loop caso a tela tenha sido alterada

      if $scene != self

        break

      end

    end

    # Preparar para transição

    Graphics.freeze

    # Exibir a janela de comandos

    @command_window.dispose

    # Exibir o gráfico de Título

    @sprite.bitmap.dispose

    @sprite.dispose

    @spritec1.bitmap.dispose

    @spritec1.dispose

    @spritec2.bitmap.dispose

    @spritec2.dispose

    @spritec3.bitmap.dispose

    @spritec3.dispose

    @spritec4.bitmap.dispose

    @spritec4.dispose

  end

  

  #--------------------------------------------------------------------------

  # Atualização do Frame

  #--------------------------------------------------------------------------

  

  alias rgss_title_update update

  def update

    @spritec1.ox += 1

    @spritec1.oy += 1

    @spritec2.ox += 1

    @spritec2.oy += 1

    @spritec3.ox += 1

    @spritec3.oy += 1

    @spritec4.ox += 1

    @spritec4.oy += 1

    # Atualizar a janela de comandos

    @command_window.update

    # Se o botão C for pressionado

    if Input.trigger?(Input::C)

      # ramificação pela posição do cursor

      case @command_window.index

      when 0  # Novo Jogo

        command_new_game

      when 1  # Continuar

        command_continue

      when 2  # Sair

        command_shutdown

      end

    end

    rgss_title_update

  end

  

  #--------------------------------------------------------------------------

  # Comando: Novo Jogo

  #--------------------------------------------------------------------------

  

  def command_new_game

    # Reproduzir SE de OK

    $game_system.se_play($data_system.decision_se)

    # Parar BGM

    Audio.bgm_stop

    # Aqui o contador de frames é resetado para que se conte o Tempo de Jogo

    Graphics.frame_count = 0

    # Criar cada tipo de objetos do jogo

    $game_temp          = Game_Temp.new

    $game_system        = Game_System.new

    $game_switches      = Game_Switches.new

    $game_variables     = Game_Variables.new

    $game_self_switches = Game_SelfSwitches.new

    $game_screen        = Game_Screen.new

    $game_actors        = Game_Actors.new

    $game_party         = Game_Party.new

    $game_troop         = Game_Troop.new

    $game_map           = Game_Map.new

    $game_player        = Game_Player.new

    # Configurar Grupo Inicial

    $game_party.setup_starting_members

    # Configurar posição inicial no mapa

    $game_map.setup($data_system.start_map_id)

    # Aqui o Jogador é movido até a posição inical configurada

    $game_player.moveto($data_system.start_x, $data_system.start_y)

    # Atualizar Jogador

    $game_player.refresh

    # Rodar, de acordo com o mapa, a BGM e a BGS

    $game_map.autoplay

    # Atualizar mapa (executar processos paralelos)

    $game_map.update

    # Mudar para a tela do mapa

    $scene = Scene_Map.new

  end

  

  #--------------------------------------------------------------------------

  # Comando: Continuar

  #--------------------------------------------------------------------------

  

  def command_continue

    # Se Continuar estiver desabilitado

    unless @continue_enabled

      # Reproduzir SE de erro

      $game_system.se_play($data_system.buzzer_se)

      return

    end

    # Reproduzir SE de OK

    $game_system.se_play($data_system.decision_se)

    # Mudar para a tela de Carregar arquivos

    $scene = Scene_Load.new

  end

  

  #--------------------------------------------------------------------------

  # Comando: Sair

  #--------------------------------------------------------------------------

  

  def command_shutdown

    # Reproduzir SE de OK

    $game_system.se_play($data_system.decision_se)

    # Diminuir o volume de BGM, BGS e ME

    Audio.bgm_fade(800)

    Audio.bgs_fade(800)

    Audio.me_fade(800)

    # Sair

    $scene = nil

  end

  

  #--------------------------------------------------------------------------

  # Teste de Batalha

  #--------------------------------------------------------------------------

  

  def battle_test

    # Carregar Banco de Dados para o Teste de Batalha

    $data_actors        = load_data("Data/BT_Actors.rxdata")

    $data_classes       = load_data("Data/BT_Classes.rxdata")

    $data_skills        = load_data("Data/BT_Skills.rxdata")

    $data_items         = load_data("Data/BT_Items.rxdata")

    $data_weapons       = load_data("Data/BT_Weapons.rxdata")

    $data_armors        = load_data("Data/BT_Armors.rxdata")

    $data_enemies       = load_data("Data/BT_Enemies.rxdata")

    $data_troops        = load_data("Data/BT_Troops.rxdata")

    $data_states        = load_data("Data/BT_States.rxdata")

    $data_animations    = load_data("Data/BT_Animations.rxdata")

    $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")

    $data_common_events = load_data("Data/BT_CommonEvents.rxdata")

    $data_system        = load_data("Data/BT_System.rxdata")

    # Aqui o contador de frames é resetado para que se conte o Tempo de Jogo

    Graphics.frame_count = 0

    # Criar cada tipo de objetos do jogo

    $game_temp          = Game_Temp.new

    $game_system        = Game_System.new

    $game_switches      = Game_Switches.new

    $game_variables     = Game_Variables.new

    $game_self_switches = Game_SelfSwitches.new

    $game_screen        = Game_Screen.new

    $game_actors        = Game_Actors.new

    $game_party         = Game_Party.new

    $game_troop         = Game_Troop.new

    $game_map           = Game_Map.new

    $game_player        = Game_Player.new

    # Configurar Grupo para o Teste de Batalha

    $game_party.setup_battle_test_members

    # Definir o ID do Grupo de Inimigos, a possibilidade de fuga e o Fundo de 

    # Batalha

    $game_temp.battle_troop_id = $data_system.test_troop_id

    $game_temp.battle_can_escape = true

    $game_map.battleback_name = $data_system.battleback_name

    # Reproduzri SE de início de batalha

    $game_system.se_play($data_system.battle_start_se)

    # Reproduzir BGM de batalha

    $game_system.bgm_play($game_system.battle_bgm)

    # Mudar para a tela de batalha

    $scene = Scene_Battle.new

  end

end

 

note if you plan to copy&paste this script, your my guest but keep in mind, you go need do use a 'title-trans' of size 400x300 (aslong with the reso script for make game 800x600), and make sure the 'title-trans' left can loop with the right side, and up side can loop with down (you can use a photo edit and resize any fog/transition from original RTP into 400x300 they work )

here an exemple how it works :), is smooth and yes, the fog is on movement :)



this issue is solved, if any admin want, feel free to lock it :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top