Lorem Ipsum
Member
I have written a script with a bit of help, but when I attempt to run it, all that happens is that a black screen appears, and you can't even exit out of it until you have waited a few seconds and pressed 'X'.
I think that there is a bit of the script that is not letting the image show, but the script runs on two things; one thing in the menu, and another that powers the window. Here are the two bits of script:
Menu script:
Window powering and calculating script:
Thanks for your help, guys.
I think that there is a bit of the script that is not letting the image show, but the script runs on two things; one thing in the menu, and another that powers the window. Here are the two bits of script:
Menu script:
Code:
elsif cmdBadges>=0 && command==cmdBadges
scene=PokemonBadgesScene.new
screen=PokemonBadges.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
@scene.pbRefresh
}
Window powering and calculating script:
Code:
class PokemonBadgesScene
def pbBadges
loop do
Graphics.update
Input.update
self.update
if Input.trigger?(Input::B)
break
end
if Input.trigger?(Input::C)
break
end
end
end
def pbEndScene
# Fade out all sprites
pbFadeOutAndHide(@sprites)
# Dispose all sprites
pbDisposeSpriteHash(@sprites)
end
def pbStartScene
# Create sprite hash
@sprites={}
# Allocate viewport
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
# Create badge window
# Refer it to it using: @sprites["badge_window"]
@sprites["badge_window"] = SpriteWindow_Base.new(0, 0,
Graphics.width,Graphics.height)
@sprites["badge_window"].contents = Bitmap.new(Graphics.width, Graphics.height)
pbBadgeCase
end
def pbBadgeCase
x, y = 0, 0
for i in 0...8
if i / 4 >= 1
x = 0
y += 480 / 2
end
if $Trainer.badges[i]
badge_image = Bitmap.new('Graphics/Pictures/dpbadges.PNG')
@sprites["badge_window"].contents.blt(x, y, badge_image, badge_image.rect)
end
x += 640 / 4
# Fade in all sprites
pbFadeInAndShow(@sprites)
end
end
end
class PokemonBadges
def initialize(scene)
@scene = scene
end
def pbStartScreen
@scene.pbStartScene
@scene.pbBadges
@scene.pbEndScene
end
end
Thanks for your help, guys.