[pedido/rgss/NPV3] estou com problemas para criar um menu com imagens...
Página 1 de 1
[pedido/rgss/NPV3] estou com problemas para criar um menu com imagens...
estou com problemas para criar um menu com imagens no NetPlay V3... tipo que cada opção é uma imagem, e não dá certo, poderia ajudar? saber criar as opções até sei, só não sei colocar para exibir a tal imagem...
[center]
Código (scene_login):
[center]
Código (scene_login):
- Código:
#==============================================================================
# ** Scene Login
#------------------------------------------------------------------------------
# By Marlos Gama
#==============================================================================
class Scene_Login# < Window_Base
#--------------------------------------------------------------------------
# Configurações
#--------------------------------------------------------------------------
USUARIO_NOME = "Usuário:"
SENHA_NOME = "Senha:"
LEMBRAR_NOME = "Lembrar? "
REGISTRAR_BOTAO = "Registrar"
ENTRAR_BOTAO = " Entrar "
#$game_screen.pictures[1].show("opções", 0, 414, 44, 100, 100, 255, 0)
#--------------------------------------------------------------------------
# Main
#--------------------------------------------------------------------------
def main
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
#@sprite.bitmap = RPG::Cache.picture("opções")#, 0, 414, 44, 100, 100, 255, 0)
#@sprite.x = 414
#@sprite.y = 44
#@sprite.z = 999999999
testando1 = RPG::Cache.picture("opções")
testando2 = 100#hpbar.width * @actor.hp / @actor.maxhp
testando3 = 100#hpbar.height
testando4 = Rect.new(0,0,testando2,testando3)
self.contents.blt(19+2,15,testando5,testando4)
#self.contents.blt(19+2,15,hud3,hud4)
@base_window = Window_Dummys5.new(185, 120, 265, 205)
@base_window.dragable = false
@window_erro = Window_Dummys.new(200,165,235,90)#Window_Dummys5.new(180,150,250,80)
@window_erro.z = 9999
@window_erro.visible = false
@window_erro.active = false
@convite_button1 = Button.new(@window_erro,@window_erro.width/3+12, 55, " Ok ") {@window_erro.visible = false; @window_erro.active = false}
@window_erro.dragable = true
@window_erro.closable = true
#@window_erro.set_modt("aaa",0, -3)
main_data
@base_window.set_text(User_Edit::LOGIN_TITLE,125, 0)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
@user_window = $user_window_text
@user_window.active = true
@base_window.set_text5(SENHA_NOME,10,35+27)
@pass_window = $pass_window_text
#AKI
@register_button = nil #Button3.new(@base_window,156,76+12+27+25-5,REGISTRAR_BOTAO) {register}
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
@mainlogin_ckh = Check_Box.new(@base_window,16,116-24+27-5)
@tempo = 0
if @user_window.text != ""
ativar_ckh
@user_window.active = false
@pass_window.active = true
end
@login_button = Button3.new(@base_window,156,76+12+27-5,ENTRAR_BOTAO) {entrando}
plusx = (640/2 - @base_window.width/2) - 100
@password = []
@user_name = []
Graphics.transition
if $servidor_off == true
else
Network::Main.retrieve_version
end
loop do
Network::Base.update
update
if $scene != self
break if main_scenechange?
end
end
Graphics.freeze
@sprite.dispose
@window_erro.dispose
@base_window.dispose
@login_button.dispose
@mainlogin_ckh.dispose
end
#--------------------------------------------------------------------------
# Salvar Conta
#--------------------------------------------------------------------------
def main_data
if FileTest.exist?("Account.rxdata")
@dati = []
file = File.open("Account.rxdata", "rb")
@dati = Marshal.load(file)
file.close
@base_window.set_username = @dati[0]
@base_window.set_password = @dati[1]
end
end
def ativar_ckh
@mainlogin_ckh.value = true
end
def main_scenechange?
if $scene != self
if @mainlogin_ckh.checked
@dati = []
@dati[0] = @base_window.username
@dati[1] = @base_window.password
file = File.open("Account.rxdata", "wb")
Marshal.dump(@dati,file)
file.close
end
return true
end
return false
end
def username
return @base_window.username
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
@base_window.update
@window_erro.update
@login_button.update
if Input.pressed(Input::Mouse_Left) and $Mouse.x >= 414 and $Mouse.x <= 537 and $Mouse.y >= 44 and $Mouse.y <= 95#@EDIT
return if $mouse_active == true
if $mouse_active != true
if $servidor_off == true
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt("O servidor está offline!",0, -3)
#@base_window.set_text2(" Nome de usuário já existe.", 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
else
if @pass_window.text != "" && @user_window.text != ""
if Network::Main.user_exist?(@base_window.username) == true
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(User_Edit::REGISTER_DENIED,0, -3)
#@base_window.set_text2(User_Edit::REGISTER_DENIED, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
else
Network::Main.send_register(@base_window.username , @base_window.password)
Network::Main.send_login(@base_window.username , @base_window.password)
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@base_window.set_text2(User_Edit::REGISTERED, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
end
else
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(User_Edit::REGISTER_ERROR,0, -3)
#@base_window.set_text2(User_Edit::REGISTER_ERROR, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
end
end
end
end
if Input.pressed(Input::Mouse_Left) and @user_window.in_area?
@user_window.active = true
@pass_window.active = false
@pass_window.refresh
return
elsif Input.pressed(Input::Mouse_Left) and @pass_window.in_area?
@user_window.active = false
@pass_window.active = true
@user_window.refresh
end
if Input.trigger?(Input::Tab) or Input.trigger?(Input::DN) and @user_window.active == true
@user_window.active = false
@pass_window.active = true
@user_window.refresh
elsif Input.trigger?(Input::Tab) or Input.trigger?(Input::UPs) and @user_window.active == false
@user_window.active = true
@pass_window.active = false
@pass_window.refresh
return
end
if Graphics.frame_count / Graphics.frame_rate != @total_sec
@tempo += 1
end
if @tempo == 4 * 10
$mouse_active = false
@tempo = 0
end
if @login_update
login
return
end
end
#--------------------------------------------------------------------------
# Set Status Text
#--------------------------------------------------------------------------
def set_status(status)
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@base_window.set_text2(status, 25, 150)
if status != "Conectando ao Servidor..."
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(status,0, -3)
end
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
end
def entrando
return if $mouse_active == true
if $mouse_active != true
if $servidor_off == true
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt("O servidor está offline!",0, -3)
#@base_window.set_text2(" Usuário Incorreto ou Logado.", 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
else
@user_window.active = false
@pass_window.active = false
@login_update = true
login
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
return true
end
end
end
def register
return if $mouse_active == true
if $mouse_active != true
if $servidor_off == true
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt("O servidor está offline!",0, -3)
#@base_window.set_text2(" Nome de usuário já existe.", 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
else
if @pass_window.text != "" && @user_window.text != ""
if Network::Main.user_exist?(@base_window.username) == true
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(User_Edit::REGISTER_DENIED,0, -3)
#@base_window.set_text2(User_Edit::REGISTER_DENIED, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
else
Network::Main.send_register(@base_window.username , @base_window.password)
Network::Main.send_login(@base_window.username , @base_window.password)
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@base_window.set_text2(User_Edit::REGISTERED, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
end
else
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(User_Edit::REGISTER_ERROR,0, -3)
#@base_window.set_text2(User_Edit::REGISTER_ERROR, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
end
end
end
end
#--------------------------------------------------------------------------
# Login
#--------------------------------------------------------------------------
def login
return if not @login_update
if @pass_window.text != "" && @user_window.text != ""
Network::Main.send_login(@base_window.username , @base_window.password)
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@base_window.set_text2(User_Edit::LOGIN_STATUS, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
@login_update = false
@cursor_pos = 1
else
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(User_Edit::LOGIN_FILLERROR,0, -3)
#@base_window.set_text2(User_Edit::LOGIN_FILLERROR, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
if $servidor_off == true
@base_window.set_text7("Servidor - Offline",73+10, 135+5)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7("Servidor - Online",73+10, 135+5)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
@login_update = false
@cursor_pos = 1
end
end
end
sam-rtp-rgss- Mensagens : 2
Data de inscrição : 30/11/2011
Idade : 26
Localização : Rj, Rj
Tópicos semelhantes
» [RGSS/Pedido]Ajuda com MOG Scene Menu
» [Pedido]Atalho para menu rmxp
» [BUG-RGSS]Star Ocean 3 Custom Menu System
» Pedido de Script de criar eventos
» [RGSS2/ Pedido] Modificação MOG menu Yui
» [Pedido]Atalho para menu rmxp
» [BUG-RGSS]Star Ocean 3 Custom Menu System
» Pedido de Script de criar eventos
» [RGSS2/ Pedido] Modificação MOG menu Yui
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos