First, mind my English... :3
I just came up with some problem with my gallery code:
Code:
init python:
# Step 1. Create the gallery object.
g = Gallery()
# Step 2. Add buttons and images to the gallery.
# A button that contains an image that automatically unlocks.
g.button("d1")
g.image("event_tmp")
g.unlock("event_tmp")
# This button has multiple images assocated with it. We use unlock_image
# so we don't have to call both .image and .unlock. We also apply a
# transform to the first image.
g.button("d2")
g.unlock_image("event_tmp2")
# The transition used when switching images.
g.transition = dissolve
# etc
g.background = "white.jpg"
# Step 3. The gallery screen we use.
screen gallery:
# Ensure this replaces the main menu.
tag menu
# The background.
add "skyblue.jpg"
# A grid of buttons.
vbox:
xpos 13 ypos 65
spacing 5
hbox:
spacing 3
# Call make_button to show a particular button.
add g.make_button("d1", "gal_d1.jpg", "gal_none.jpg",xalign=0.5, yalign=0.5)
add g.make_button("d2", "gal_d2.jpg", "gal_none.jpg",xalign=0.5, yalign=0.5)
# The screen is responsible for returning to the main menu. It could also
# navigate to other gallery screens.
textbutton "Return" action Return() xanchor 0.5 yanchor 0.5 xpos 0.85 ypos 0.9
(actually I have 33 pics to show in my gallery but for your convenience I cropped the repeating part)
So, the problem is, when I click on the button to see the image, the image comes out, the bottom edge of the image sticked to the bottom of the game window.
The images I use in my game are smaller than the size of the game window, so I think that's the problem.... usually the cgs are in the same size as the game window, right?
Anyway, I want to see the image in the center of the game window. Somebody please help me with this?!
I found this problem just two days before the actual release .... clumsy of me.