Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Wed Jun 19, 2013 2:44 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Apr 10, 2012 7:32 am 
Newbie

Joined: Sat Dec 31, 2011 7:29 am
Posts: 3
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.


Top
 Profile Send private message  
 
PostPosted: Wed Apr 11, 2012 9:34 am 
Regular

Joined: Tue Apr 03, 2012 9:17 am
Posts: 88
Location: Seoul, South Korea
Projects: Dandelion
Organization: Cheritz
Try putting your screen in a frame and then doing xpos 0.5 ypos 0.5


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: crimsonnight


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group