Rispondi 
[Scripting] Aumentare velocità animazione menù personalizzato
Alex2000
Tuttofare
***
Offline

Messaggi: 197
Registrato: 28-01-2015
Reputazione: 1
Mi Piace Ricevuti: 27
PokéMoney: 406.75₱
Messaggio: #1
Question Aumentare velocità animazione menù personalizzato
Attualmente nel mio Progetto RPG ( PDD ), sto usando il Menù Personalizzato di xZekro51:
Codice:
class MenuEssentials

def createSpritesets
@spritesets={}
for map in $MapFactory.maps
@spritesets[map.map_id]=Spriteset_Map.new(map)
end
$MapFactory.setSceneStarted(self)
updateSpritesets
pbMenu
end

def disposeSpritesets
return if !@spritesets
for i in @spritesets.keys
if @spritesets[i]
@spritesets[i].dispose
@spritesets[i]=nil
end
end
@spritesets.clear
@spritesets={}
pbDisposeSpriteHash(@sprites)
end

def updateMenu
pbUpdateSpriteHash(@sprites)
end

def main
createSpritesets
Graphics.transition
loop do
Graphics.update
Input.update
if $Trainer
# pbMenu
end
if $scene != self
break
end
end
Graphics.freeze
disposeSpritesets
if $game_temp.to_title
Graphics.transition
Graphics.freeze
end
end

################################################################################​​​​
# Creazione immagini
################################################################################​​​​
def pbMenu
@sprites={}
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=5000
if $Trainer #QUI SOTTO TUTTE LE IMMAGINI
@sprites["bg"]=Sprite.new(@viewport)
@sprites["bg"].bitmap=pbBitmap("Graphics/PEMENU/Bg")
@sprites["bg"].opacity=0
@sprites["chbg"]=Sprite.new(@viewport)
@sprites["chbg"].bitmap=pbBitmap("Graphics/PEMENU/chbg1")
@sprites["chbg"].x=0-@sprites["chbg"].bitmap.width
@sprites["chbg"].y=40
@sprites["chbg1"]=Sprite.new(@viewport)
@sprites["chbg1"].bitmap=pbBitmap("Graphics/PEMENU/chbg2")
@sprites["chbg1"].x=0-@sprites["chbg"].bitmap.width
@sprites["chbg1"].y=40+@sprites["chbg"].bitmap.height
@sprites["chbg2"]=Sprite.new(@viewport)
@sprites["chbg2"].bitmap=pbBitmap("Graphics/PEMENU/chbg3")
@sprites["chbg2"].x=0-@sprites["chbg"].bitmap.width
@sprites["chbg2"].y=40+@sprites["chbg"].bitmap.height*2
@sprites["chbg3"]=Sprite.new(@viewport)
@sprites["chbg3"].bitmap=pbBitmap("Graphics/PEMENU/chbg4")
@sprites["chbg3"].x=0-@sprites["chbg"].bitmap.width
@sprites["chbg3"].y=40+@sprites["chbg"].bitmap.height*3
@sprites["chbg4"]=Sprite.new(@viewport)
@sprites["chbg4"].bitmap=pbBitmap("Graphics/PEMENU/chbg5")
@sprites["chbg4"].x=0-@sprites["chbg"].bitmap.width
@sprites["chbg4"].y=40+@sprites["chbg"].bitmap.height*4
@sprites["chbg5"]=Sprite.new(@viewport)
@sprites["chbg5"].bitmap=pbBitmap("Graphics/PEMENU/chbg6")
@sprites["chbg5"].x=0-@sprites["chbg"].bitmap.width
@sprites["chbg5"].y=40+@sprites["chbg"].bitmap.height*5
@sprites["chbg6"]=Sprite.new(@viewport)
@sprites["chbg6"].bitmap=pbBitmap("Graphics/PEMENU/chbg")
@sprites["chbg6"].x=0-@sprites["chbg"].bitmap.width
@sprites["chbg6"].y=40+@sprites["chbg"].bitmap.height*6
xwrite=60
base=Color.new(255,255,255)
shadow=Color.new(32,32,32)
@sprites["dch"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["dch"].opacity=0
dch1=@sprites["dch"].bitmap
dch1.clear
pbSetSystemFont(dch1)
txt1=[]
if $Trainer.pokedex==true && $Trainer.party.length>0
txt1.push([_INTL("Pokédex"),xwrite-2,@sprites["chbg"].y+6-2,2,shadow,shadow])
txt1.push([_INTL("Pokédex"),xwrite,@sprites["chbg"].y+6-2,2,shadow,shadow])
txt1.push([_INTL("Pokédex"),xwrite-2,@sprites["chbg"].y+6,2,shadow,shadow])
txt1.push([_INTL("Pokédex"),xwrite,@sprites["chbg"].y+6,2,base,shadow])
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
txt1.push([_INTL("Pokémon"),xwrite-2,@sprites["chbg"].y+6-2,2,shadow,shadow])
txt1.push([_INTL("Pokémon"),xwrite,@sprites["chbg"].y+6-2,2,shadow,shadow])
txt1.push([_INTL("Pokémon"),xwrite-2,@sprites["chbg"].y+6,2,shadow,shadow])
txt1.push([_INTL("Pokémon"),xwrite,@sprites["chbg"].y+6,2,base,shadow])
elsif $Trainer.pokedex==true
txt1.push([_INTL("Pokédex"),xwrite-2,@sprites["chbg"].y+6-2,2,shadow,shadow])
txt1.push([_INTL("Pokédex"),xwrite,@sprites["chbg"].y+6-2,2,shadow,shadow])
txt1.push([_INTL("Pokédex"),xwrite-2,@sprites["chbg"].y+6,2,shadow,shadow])
txt1.push([_INTL("Pokédex"),xwrite,@sprites["chbg"].y+6,2,base,shadow])
else
txt1.push([_INTL("Zaino"),xwrite-2,@sprites["chbg"].y+6-2,2,shadow,shadow])
txt1.push([_INTL("Zaino"),xwrite,@sprites["chbg"].y+6-2,2,shadow,shadow])
txt1.push([_INTL("Zaino"),xwrite-2,@sprites["chbg"].y+6,2,shadow,shadow])
txt1.push([_INTL("Zaino"),xwrite,@sprites["chbg"].y+6,2,base,shadow])
end
@sprites["dch1"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["dch1"].opacity=0
dch2=@sprites["dch1"].bitmap
dch2.clear
pbSetSystemFont(dch2)
txt2=[]
if $Trainer.pokedex==true && $Trainer.party.length>0
txt2.push([_INTL("Pokémon"),xwrite-2,@sprites["chbg1"].y+6-2,2,shadow,shadow])
txt2.push([_INTL("Pokémon"),xwrite,@sprites["chbg1"].y+6-2,2,shadow,shadow])
txt2.push([_INTL("Pokémon"),xwrite-2,@sprites["chbg1"].y+6,2,shadow,shadow])
txt2.push([_INTL("Pokémon"),xwrite,@sprites["chbg1"].y+6,2,base,shadow])
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
txt2.push([_INTL("Zaino"),xwrite-2,@sprites["chbg1"].y+6-2,2,shadow,shadow])
txt2.push([_INTL("Zaino"),xwrite,@sprites["chbg1"].y+6-2,2,shadow,shadow])
txt2.push([_INTL("Zaino"),xwrite-2,@sprites["chbg1"].y+6,2,shadow,shadow])
txt2.push([_INTL("Zaino"),xwrite,@sprites["chbg1"].y+6,2,base,shadow])
elsif $Trainer.pokedex==true
txt2.push([_INTL("Zaino"),xwrite-2,@sprites["chbg1"].y+6-2,2,shadow,shadow])
txt2.push([_INTL("Zaino"),xwrite,@sprites["chbg1"].y+6-2,2,shadow,shadow])
txt2.push([_INTL("Zaino"),xwrite-2,@sprites["chbg1"].y+6,2,shadow,shadow])
txt2.push([_INTL("Zaino"),xwrite,@sprites["chbg1"].y+6,2,base,shadow])
else
txt2.push([_INTL("Salva"),xwrite-2,@sprites["chbg1"].y+6-2,2,shadow,shadow])
txt2.push([_INTL("Salva"),xwrite,@sprites["chbg1"].y+6-2,2,shadow,shadow])
txt2.push([_INTL("Salva"),xwrite-2,@sprites["chbg1"].y+6,2,shadow,shadow])
txt2.push([_INTL("Salva"),xwrite,@sprites["chbg1"].y+6,2,base,shadow])
end
#txt2.push([_INTL("Salva"),xwrite-2,@sprites["chbg1"].y+6-2,2,shadow,shadow])
#txt2.push([_INTL("Salva"),xwrite,@sprites["chbg1"].y+6-2,2,shadow,shadow])
#txt2.push([_INTL("Salva"),xwrite-2,@sprites["chbg1"].y+6,2,shadow,shadow])
#txt2.push([_INTL("Salva"),xwrite,@sprites["chbg1"].y+6,2,base,shadow])

@sprites["dch2"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["dch2"].opacity=0
dch3=@sprites["dch2"].bitmap
dch3.clear
pbSetSystemFont(dch3)
txt3=[]
if $Trainer.pokedex==true && $Trainer.party.length>0
txt3.push([_INTL("Zaino"),xwrite-2,@sprites["chbg2"].y+6-2,2,shadow,shadow])
txt3.push([_INTL("Zaino"),xwrite,@sprites["chbg2"].y+6-2,2,shadow,shadow])
txt3.push([_INTL("Zaino"),xwrite-2,@sprites["chbg2"].y+6,2,shadow,shadow])
txt3.push([_INTL("Zaino"),xwrite,@sprites["chbg2"].y+6,2,base,shadow])
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
txt3.push([_INTL("Salva"),xwrite-2,@sprites["chbg2"].y+6-2,2,shadow,shadow])
txt3.push([_INTL("Salva"),xwrite,@sprites["chbg2"].y+6-2,2,shadow,shadow])
txt3.push([_INTL("Salva"),xwrite-2,@sprites["chbg2"].y+6,2,shadow,shadow])
txt3.push([_INTL("Salva"),xwrite,@sprites["chbg2"].y+6,2,base,shadow])
elsif $Trainer.pokedex==true
txt3.push([_INTL("Salva"),xwrite-2,@sprites["chbg2"].y+6-2,2,shadow,shadow])
txt3.push([_INTL("Salva"),xwrite,@sprites["chbg2"].y+6-2,2,shadow,shadow])
txt3.push([_INTL("Salva"),xwrite-2,@sprites["chbg2"].y+6,2,shadow,shadow])
txt3.push([_INTL("Salva"),xwrite,@sprites["chbg2"].y+6,2,base,shadow])
else
txt3.push([_INTL("{1}",$Trainer.name),xwrite-2,@sprites["chbg2"].y+6-2,2,shadow,shadow])
txt3.push([_INTL("{1}",$Trainer.name),xwrite,@sprites["chbg2"].y+6-2,2,shadow,shadow])
txt3.push([_INTL("{1}",$Trainer.name),xwrite-2,@sprites["chbg2"].y+6,2,shadow,shadow])
txt3.push([_INTL("{1}",$Trainer.name),xwrite,@sprites["chbg2"].y+6,2,base,shadow])
end

@sprites["dch3"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["dch3"].opacity=0
dch4=@sprites["dch3"].bitmap
dch4.clear
pbSetSystemFont(dch4)
txt4=[]
if $Trainer.pokedex==true && $Trainer.party.length>0
txt4.push([_INTL("Salva"),xwrite-2,@sprites["chbg3"].y+6-2,2,shadow,shadow])
txt4.push([_INTL("Salva"),xwrite,@sprites["chbg3"].y+6-2,2,shadow,shadow])
txt4.push([_INTL("Salva"),xwrite-2,@sprites["chbg3"].y+6,2,shadow,shadow])
txt4.push([_INTL("Salva"),xwrite,@sprites["chbg3"].y+6,2,base,shadow])
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
txt4.push([_INTL("{1}",$Trainer.name),xwrite-2,@sprites["chbg3"].y+6-2,2,shadow,shadow])
txt4.push([_INTL("{1}",$Trainer.name),xwrite,@sprites["chbg3"].y+6-2,2,shadow,shadow])
txt4.push([_INTL("{1}",$Trainer.name),xwrite-2,@sprites["chbg3"].y+6,2,shadow,shadow])
txt4.push([_INTL("{1}",$Trainer.name),xwrite,@sprites["chbg3"].y+6,2,base,shadow])
elsif $Trainer.pokedex==true
txt4.push([_INTL("{1}",$Trainer.name),xwrite-2,@sprites["chbg3"].y+6-2,2,shadow,shadow])
txt4.push([_INTL("{1}",$Trainer.name),xwrite,@sprites["chbg3"].y+6-2,2,shadow,shadow])
txt4.push([_INTL("{1}",$Trainer.name),xwrite-2,@sprites["chbg3"].y+6,2,shadow,shadow])
txt4.push([_INTL("{1}",$Trainer.name),xwrite,@sprites["chbg3"].y+6,2,base,shadow])
else
txt4.push([_INTL("Opzioni"),xwrite-2,@sprites["chbg3"].y+6-2,2,shadow,shadow])
txt4.push([_INTL("Opzioni"),xwrite,@sprites["chbg3"].y+6-2,2,shadow,shadow])
txt4.push([_INTL("Opzioni"),xwrite-2,@sprites["chbg3"].y+6,2,shadow,shadow])
txt4.push([_INTL("Opzioni"),xwrite,@sprites["chbg3"].y+6,2,base,shadow])
end

@sprites["dch4"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["dch4"].opacity=0
dch5=@sprites["dch4"].bitmap
dch5.clear
pbSetSystemFont(dch5)
txt5=[]
if $Trainer.pokedex==true && $Trainer.party.length>0
txt5.push([_INTL("{1}",$Trainer.name),xwrite-2,@sprites["chbg4"].y+6-2,2,shadow,shadow])
txt5.push([_INTL("{1}",$Trainer.name),xwrite,@sprites["chbg4"].y+6-2,2,shadow,shadow])
txt5.push([_INTL("{1}",$Trainer.name),xwrite-2,@sprites["chbg4"].y+6,2,shadow,shadow])
txt5.push([_INTL("{1}",$Trainer.name),xwrite,@sprites["chbg4"].y+6,2,base,shadow])
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
txt5.push([_INTL("Opzioni"),xwrite-2,@sprites["chbg4"].y+6-2,2,shadow,shadow])
txt5.push([_INTL("Opzioni"),xwrite,@sprites["chbg4"].y+6-2,2,shadow,shadow])
txt5.push([_INTL("Opzioni"),xwrite-2,@sprites["chbg4"].y+6,2,shadow,shadow])
txt5.push([_INTL("Opzioni"),xwrite,@sprites["chbg4"].y+6,2,base,shadow])
elsif $Trainer.pokedex==true
txt5.push([_INTL("Opzioni"),xwrite-2,@sprites["chbg4"].y+6-2,2,shadow,shadow])
txt5.push([_INTL("Opzioni"),xwrite,@sprites["chbg4"].y+6-2,2,shadow,shadow])
txt5.push([_INTL("Opzioni"),xwrite-2,@sprites["chbg4"].y+6,2,shadow,shadow])
txt5.push([_INTL("Opzioni"),xwrite,@sprites["chbg4"].y+6,2,base,shadow])
else
txt5.push([_INTL(""),xwrite-2,@sprites["chbg4"].y+6-2,2,shadow,shadow])
txt5.push([_INTL(""),xwrite,@sprites["chbg4"].y+6-2,2,shadow,shadow])
txt5.push([_INTL(""),xwrite-2,@sprites["chbg4"].y+6,2,shadow,shadow])
txt5.push([_INTL(""),xwrite,@sprites["chbg4"].y+6,2,base,shadow])
end

@sprites["dch5"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["dch5"].opacity=0
dch6=@sprites["dch5"].bitmap
dch6.clear
pbSetSystemFont(dch6)
txt6=[]
if $Trainer.pokedex==true && $Trainer.party.length>0
txt6.push([_INTL("Opzioni"),xwrite-2,@sprites["chbg5"].y+6-2,2,shadow,shadow])
txt6.push([_INTL("Opzioni"),xwrite,@sprites["chbg5"].y+6-2,2,shadow,shadow])
txt6.push([_INTL("Opzioni"),xwrite-2,@sprites["chbg5"].y+6,2,shadow,shadow])
txt6.push([_INTL("Opzioni"),xwrite,@sprites["chbg5"].y+6,2,base,shadow])
end
@sprites["dch6"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["dch6"].opacity=0
dch7=@sprites["dch5"].bitmap
dch7.clear
pbSetSystemFont(dch7)
txt7=[]
if $DEBUG==true
txt7.push([_INTL("Debug(Z)"),xwrite-2,@sprites["chbg6"].y+6-2,2,shadow,shadow])
txt7.push([_INTL("Debug(Z)"),xwrite,@sprites["chbg6"].y+6-2,2,shadow,shadow])
txt7.push([_INTL("Debug(Z)"),xwrite-2,@sprites["chbg6"].y+6,2,shadow,shadow])
txt7.push([_INTL("Debug(Z)"),xwrite,@sprites["chbg6"].y+6,2,base,shadow])
end

@sprites["Time"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["Time"].opacity=0
time=@sprites["Time"].bitmap
time.clear
pbSetSystemLargeFont(time)
timetext=[
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96-4,Graphics.height/2-90-4,2,shadow,shadow],
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96-4,Graphics.height/2-90,2,shadow,shadow],
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96,Graphics.height/2-90-4,2,shadow,shadow],
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96+2,Graphics.height/2-90+2,2,shadow,shadow],
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96,Graphics.height/2-90+2,2,shadow,shadow],
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96+2,Graphics.height/2-90-2,2,shadow,shadow],
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96-2,Graphics.height/2-90+2,2,shadow,shadow],
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96,Graphics.height/2-90,2,base,shadow],
[_ISPRINTF("{1: 2d}:{2:2d}",Time.now.hour, Time.now.min),Graphics.width/2+96-2,Graphics.height/2-90-2,2,base,base],
]

@sprites["Map"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
@sprites["Map"].opacity=0
map=@sprites["Map"].bitmap
map.clear
pbSetSystemFont(map)
maptext=[
[_INTL("{1}",$game_map.name),Graphics.width/2+100-2,Graphics.height/2-2,2,shadow,shadow],
[_INTL("{1}",$game_map.name),Graphics.width/2+100-2,Graphics.height/2,2,shadow,shadow],
[_INTL("{1}",$game_map.name),Graphics.width/2+100,Graphics.height/2-2,2,shadow,shadow],
[_INTL("{1}",$game_map.name),Graphics.width/2+100,Graphics.height/2,2,base,shadow],
]
#SCRITTURA TESTI
pbDrawTextPositions(map,maptext)
pbDrawTextPositions(time,timetext)
pbDrawTextPositions(dch7,txt7)
pbDrawTextPositions(dch6,txt6)
pbDrawTextPositions(dch5,txt5)
pbDrawTextPositions(dch4,txt4)
pbDrawTextPositions(dch3,txt3)
pbDrawTextPositions(dch2,txt2)
pbDrawTextPositions(dch1,txt1)
end
end

def update
pbUpdateSpriteHash(@sprites)
end

def pbComandi_menu
endscene=true
@menuopen=false
ch1=1
ch2=0
ch3=0
ch4=0
ch5=0
ch6=0
ch7=0
#ANIMAZIONE APERTURA
if Input.trigger?(Input::B) && @menuopen==false
10.times do
@sprites["bg"].opacity+=25.5
Graphics.update
Input.update
update
end
10.times do
@sprites["Time"].opacity+=25.5
@sprites["Map"].opacity+=25.5
Graphics.update
Input.update
update
end
10.times do
@sprites["chbg"].x+=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
7.times do
@sprites["dch"].opacity+=50
Graphics.update
Input.update
update
end
10.times do
@sprites["chbg1"].x+=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
7.times do
@sprites["dch1"].opacity+=50
Graphics.update
Input.update
update
end
10.times do
@sprites["chbg2"].x+=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
7.times do
@sprites["dch2"].opacity+=50
Graphics.update
Input.update
update
end
10.times do
@sprites["chbg3"].x+=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
7.times do
@sprites["dch3"].opacity+=50
Graphics.update
Input.update
update
end
if $Trainer.party.length>0 || $Trainer.pokedex==true
10.times do
@sprites["chbg4"].x+=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
7.times do
@sprites["dch4"].opacity+=50
Graphics.update
Input.update
update
end
end
if $Trainer.party.length>0
if $Trainer.pokedex==true
10.times do
@sprites["chbg5"].x+=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
7.times do
@sprites["dch5"].opacity+=50
Graphics.update
Input.update
update
end
end
end
if $DEBUG==true
10.times do
@sprites["chbg6"].x+=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
7.times do
@sprites["dch6"].opacity+=50
Graphics.update
Input.update
update
end
end
@menuopen=true
end
loop do
Graphics.update
Input.update
update
if ch1==1
4.times do
@sprites["chbg"].x+=8
Graphics.update
update
Input.update
ch1=0.5
end
end
if ch1==-1
4.times do
@sprites["chbg"].x-=8
Graphics.update
update
Input.update
ch1=0
end
end
if ch2==1
4.times do
@sprites["chbg1"].x+=8
Graphics.update
update
Input.update
ch2=0.5
end
end
if ch2==-1
4.times do
@sprites["chbg1"].x-=8
Graphics.update
update
Input.update
ch2=0
end
end
if ch3==1
4.times do
@sprites["chbg2"].x+=8
Graphics.update
update
Input.update
ch3=0.5
end
end
if ch3==-1
4.times do
@sprites["chbg2"].x-=8
Graphics.update
update
Input.update
ch3=0
end
end
if ch4==1
4.times do
@sprites["chbg3"].x+=8
Graphics.update
update
Input.update
ch4=0.5
end
end
if ch4==-1
4.times do
@sprites["chbg3"].x-=8
Graphics.update
update
Input.update
ch4=0
end
end
if ch5==1
4.times do
@sprites["chbg4"].x+=8
Graphics.update
update
Input.update
ch5=0.5
end
end
if ch5==-1
4.times do
@sprites["chbg4"].x-=8
Graphics.update
update
Input.update
ch5=0
end
end
if ch6==1
4.times do
@sprites["chbg5"].x+=8
Graphics.update
update
Input.update
ch6=0.5
end
end
if ch6==-1
4.times do
@sprites["chbg5"].x-=8
Graphics.update
update
Input.update
ch6=0
end
end

#COMANDI MENU
if Input.trigger?(Input::DOWN) && ch1==0.5
ch1=-1
ch2=1
end
if Input.trigger?(Input::DOWN) && ch2==0.5
ch2=-1
ch3=1
end
if Input.trigger?(Input::DOWN) && ch3==0.5
ch3=-1
ch4=1
end
if Input.trigger?(Input::DOWN) && ch4==0.5
if $Trainer.pokedex==true || $Trainer.party.length>0
ch4=-1
ch5=1
else
ch4=-1
ch1=1
end
end
if Input.trigger?(Input::DOWN) && ch5==0.5
if $Trainer.pokedex==true && $Trainer.party.length>0
ch5=-1
ch6=1
else
ch5=-1
ch1=1
end
end
if Input.trigger?(Input::DOWN) && ch6==0.5
ch6=-1
ch1=1
end
if Input.trigger?(Input::UP) && ch1==0.5
if $Trainer.pokedex==true && $Trainer.party.length>0
ch1=-1
ch6=1
elsif $Trainer.pokedex==true || $Trainer.party.length>0
ch1=-1
ch5=1
else
ch1=-1
ch4=1
end
end
if Input.trigger?(Input::UP) && ch2==0.5
ch2=-1
ch1=1
end
if Input.trigger?(Input::UP) && ch3==0.5
ch3=-1
ch2=1
end
if Input.trigger?(Input::UP) && ch4==0.5
ch4=-1
ch3=1
end
if Input.trigger?(Input::UP) && ch5==0.5
ch5=-1
ch4=1
end
if Input.trigger?(Input::UP) && ch6==0.5
ch6=-1
ch5=1
end
#Spostamento cursore
if Input.trigger?(Input::C) && ch1==0.5
if $Trainer.party.length>0 && $Trainer.pokedex==false
pbPlayDecisionSE()
sscene=PokemonScreen_Scene.new
sscreen=PokemonScreen.new(sscene,$Trainer.party)
hiddenmove=nil
pbFadeOutIn(99999) {
hiddenmove=sscreen.pbPokemonScreen
if hiddenmove
end
}
elsif $Trainer.party.length>0 && $Trainer.pokedex==true
pbPlayDecisionSE()
pbFadeOutIn(99999) {
scene=PokemonPokedexScene.new
screen=PokemonPokedex.new(scene)
screen.pbStartScreen
}
else
pbPlayDecisionSE()
item=0
scene=PokemonBag_Scene.new
screen=PokemonBagScreen.new(scene,$PokemonBag)
pbFadeOutIn(99999) {
item=screen.pbStartScreen
if item>0
break
end
}
if item>0
Kernel.pbUseKeyItemInField(item)
return
end
end
end
if Input.trigger?(Input::C) && ch2==0.5
if $Trainer.party.length>0 && $Trainer.pokedex==true
pbPlayDecisionSE()
sscene=PokemonScreen_Scene.new
sscreen=PokemonScreen.new(sscene,$Trainer.party)
hiddenmove=nil
pbFadeOutIn(99999) {
hiddenmove=sscreen.pbPokemonScreen
if hiddenmove
end
}
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
pbPlayDecisionSE()
item=0
scene=PokemonBag_Scene.new
screen=PokemonBagScreen.new(scene,$PokemonBag)
pbFadeOutIn(99999) {
item=screen.pbStartScreen
if item>0
break
end
}
else
pbPlayDecisionSE()
scene=PokemonSaveScene.new
screen=PokemonSave.new(scene)
if screen.pbSaveScreen
end
end
end
if Input.trigger?(Input::C) && ch3==0.5
if $Trainer.party.length>0 && $Trainer.pokedex==true
pbPlayDecisionSE()
item=0
scene=PokemonBag_Scene.new
screen=PokemonBagScreen.new(scene,$PokemonBag)
pbFadeOutIn(99999) {
item=screen.pbStartScreen
if item>0
break
end
}
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
pbPlayDecisionSE()
scene=PokemonSaveScene.new
screen=PokemonSave.new(scene)
if screen.pbSaveScreen
end
else
pbPlayDecisionSE()
scene=PokemonTrainerCardScene.new
screen=PokemonTrainerCard.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
}
end
end
if Input.trigger?(Input::C) && ch4==0.5
if $Trainer.party.length>0 && $Trainer.pokedex==true
pbPlayDecisionSE()
scene=PokemonSaveScene.new
screen=PokemonSave.new(scene)
if screen.pbSaveScreen
end
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
pbPlayDecisionSE()
scene=PokemonTrainerCardScene.new
screen=PokemonTrainerCard.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
}
else
pbPlayDecisionSE()
pbFadeOutIn(99999) {
scene=PokemonOptionScene.new
screen=PokemonOption.new(scene)
screen.pbStartScreen
}
end
end
if Input.trigger?(Input::C) && ch5==0.5
if $Trainer.party.length>0 && $Trainer.pokedex==true
pbPlayDecisionSE()
scene=PokemonTrainerCardScene.new
screen=PokemonTrainerCard.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
}
elsif $Trainer.party.length>0 && $Trainer.pokedex==false
pbPlayDecisionSE()
pbFadeOutIn(99999) {
scene=PokemonOptionScene.new
screen=PokemonOption.new(scene)
screen.pbStartScreen
}
end
end
if Input.trigger?(Input::C) && ch6==0.5
pbPlayDecisionSE()
pbFadeOutIn(99999) {
scene=PokemonOptionScene.new
screen=PokemonOption.new(scene)
screen.pbStartScreen
}
end
if Input.triggerex?(0x5A) && $DEBUG==true
pbPlayDecisionSE()
pbFadeOutIn(99999) {
pbDebugMenu
}
end


#ANIMAZIONE CHIUSURA
if Input.trigger?(Input::B) && @menuopen==true
@menuopen=false
10.times do
@sprites["dch"].opacity-=50
Graphics.update
Input.update
update
end
if ch1==0.5
10.times do
@sprites["chbg"].x-=@sprites["chbg"].bitmap.width/12+5
Graphics.update
Input.update
update
end
else
10.times do
@sprites["chbg"].x-=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
end
10.times do
@sprites["dch1"].opacity-=50
Graphics.update
Input.update
update
end
if ch2==0.5
10.times do
@sprites["chbg1"].x-=@sprites["chbg"].bitmap.width/12+5
Graphics.update
Input.update
update
end
else
10.times do
@sprites["chbg1"].x-=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
end
10.times do
@sprites["dch2"].opacity-=50
Graphics.update
Input.update
update
end
if ch3==0.5
10.times do
@sprites["chbg2"].x-=@sprites["chbg"].bitmap.width/12+5
Graphics.update
Input.update
update
end
else
10.times do
@sprites["chbg2"].x-=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
end
10.times do
@sprites["dch3"].opacity-=50
Graphics.update
Input.update
update
end
if ch4==0.5
10.times do
@sprites["chbg3"].x-=@sprites["chbg"].bitmap.width/12+5
Graphics.update
Input.update
update
end
else
10.times do
@sprites["chbg3"].x-=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
end
if $Trainer.party.length>0 || $Trainer.pokedex==true
10.times do
@sprites["dch4"].opacity-=50
Graphics.update
Input.update
update
end
if ch5==0.5
10.times do
@sprites["chbg4"].x-=@sprites["chbg"].bitmap.width/12+5
Graphics.update
Input.update
update
end
else
10.times do
@sprites["chbg4"].x-=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
end
end
if $Trainer.party.length>0
if $Trainer.pokedex==true
10.times do
@sprites["dch5"].opacity-=50
Graphics.update
Input.update
update
end
if ch6==0.5
10.times do
@sprites["chbg5"].x-=@sprites["chbg"].bitmap.width/12+5
Graphics.update
Input.update
update
end
else
10.times do
@sprites["chbg5"].x-=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
end
10.times do
@sprites["chbg6"].x-=@sprites["chbg"].bitmap.width/12
Graphics.update
Input.update
update
end
end
end
10.times do
@sprites["Time"].opacity-=25.5
@sprites["Map"].opacity-=25.5
Graphics.update
Input.update
update
end
10.times do
@sprites["bg"].opacity-=25.5
Graphics.update
Input.update
update
end
break
end
end
end


def pbEndScene
pbDisposeSpriteHash(@sprites)
@viewport.dispose
end

def pbBitmap(percorso)
return BitmapCache.load_bitmap(percorso)
end


end
################################################################################​​​​
# Richiamo la scena
################################################################################​​​​

class CallMenuEssentials

def initialize(scene)
@scene=scene
end

def pbStartMenu
@scene.pbMenu
@scene.pbComandi_menu
@scene.pbEndScene
end

def pbCallMenu
pbFadeOutIn(99999) {
scene=MenuEssentials.new
screen=CallMenuEssentials.new(scene)
screen.pbStartMenu
}
end
end

def pbSetSystemLargeFont(bitmap)
bitmap.font.name=MessageConfig.pbGetSystemFontName()
bitmap.font.size=62
end

È molto bello, ma il fatto che mi rompe tanto è che ha un'animazione lenta, e da fastidio. Ho provato a mettere mano al codice, ma mi causa solo errori o non va. Se qualcuno che se ne intende più di me può aiutarmi mi fa un gran piacere. Grazie!
26-11-2017 10:23 PM
Cerca Cita
LD3005
Music Composer - Sidereal Works
****
Offline

Messaggi: 394
Registrato: 07-01-2015
Reputazione: 16
Mi Piace Ricevuti: 268
PokéMoney: 491.50₱
Messaggio: #2
RE: Aumentare velocità animazione menù personalizzato
Credo che la chiave di tutto sia qui ma potrei sbagliarmi:
[Immagine: CTmIlck.png]

10.times indica che l'operazione seguente viene svolta 10 volte. In questo caso, si parla di un incremento di opacità. Se riduci il numero di volte e aumenti l'incremento dovresti ottenere lo stesso effetto in un intervallo di tempo minore, anche se (in parte) più scattoso e meno fluido.
es: 8.times, incremento di 32 (invece che 25,5)

Taggo @xZekro51:., così potrà darti una mano in prima persona se avrà voglia e tempo Big Grin
Può darsi che sia riuscito io ad aiutarti, chissà.
Facci sapere!

EDIT: Dovrai modificare anche gli altri incrementi e non soltanto quello che ti ho screennato io.
(Questo messaggio è stato modificato l'ultima volta il: 26-11-2017 10:54 PM da LD3005.)
26-11-2017 10:53 PM
Sito Web Cerca Cita
 Mi piace ricevuti da: Alex2000
Alex2000
Tuttofare
***
Offline

Messaggi: 197
Registrato: 28-01-2015
Reputazione: 1
Mi Piace Ricevuti: 27
PokéMoney: 406.75₱
Messaggio: #3
RE: Aumentare velocità animazione menù personalizzato
(26-11-2017 10:53 PM)LD3005 Ha scritto:  Credo che la chiave di tutto sia qui ma potrei sbagliarmi:
[Immagine: CTmIlck.png]

10.times indica che l'operazione seguente viene svolta 10 volte. In questo caso, si parla di un incremento di opacità. Se riduci il numero di volte e aumenti l'incremento dovresti ottenere lo stesso effetto in un intervallo di tempo minore, anche se (in parte) più scattoso e meno fluido.
es: 8.times, incremento di 32 (invece che 25,5)

Taggo @xZekro51:., così potrà darti una mano in prima persona se avrà voglia e tempo Big Grin
Può darsi che sia riuscito io ad aiutarti, chissà.
Facci sapere!

EDIT: Dovrai modificare anche gli altri incrementi e non soltanto quello che ti ho screennato io.
Grazie mille!
Quando provai io cambiavo solo il 10 prima di ".times do" e quindi per questo buggava. Ho messo mano anche all'opacità.
è diventato "5.times do" e "opacity+=50"; inoltre ho modificato anche un'altra cosa:
Codice:
@sprites["chbg"].x-=@sprites["chbg"].bitmap.width/12
diventa
Codice:
@sprites["chbg"].x-=@sprites["chbg"].bitmap.width/6
Il 12 diventa 6.
Grazie mille Smile RISOLTO
(Questo messaggio è stato modificato l'ultima volta il: 27-11-2017 12:02 AM da Alex2000.)
26-11-2017 11:58 PM
Cerca Cita
 Mi piace ricevuti da: LD3005
Rispondi 




Utente(i) che stanno guardando questa discussione: 1 Ospite(i)
Powered by MyBB, © 2002-2017 MyBB Group. Copyright © | 2015 Pokémon Hacking