Sprites in Galleries?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
carosene
Veteran
Posts: 342
Joined: Wed Aug 13, 2008 4:55 pm
Completed: That Cheap and Sacred Thing
Location: California
Contact:

Sprites in Galleries?

#1 Post by carosene »

So, I'm trying to make a gallery and I separated the sprites, the Cgs, and the backgrounds each have their own "page" on the menu. The CGs and Backgrounds look great and they display just the way I want them to.

However, the sprites display strangely. When you click through one character's different sprites, the background is suddenly black, dissolves or fades the sprite in and out (depending on which option I put on the code I put below), and then the background is suddenly transparent.

I'm not a big fan of the transparent background, but the obnoxious part is the way it appears with no transition.

I want to know if there's a way to either
A. Put a background behind the sprite that transitions with the sprite or
B. Make the game transition to the transparent background

I created my gallery by copying from the example here: http://www.renpy.org/wiki/renpy/doc/coo ... CG_Gallery
And I added this code here: http://www.renpy.org/w/images/8/89/new_gallery.rpy

On that second page of code I just mentioned, I tried messing around with this here:

Code: Select all

    class Gallery(object):

        transition = dissolve
        
        locked_button = None
        locked_background = "#000"
                
        hover_border = None
        idle_border = None

        background = None
but I couldn't figure out what to do with it or if I was in the right section.

Here's the way my transitions are set in the options file:

Code: Select all

    ## Transitions.

    ## Used when entering the game menu from the game.

    config.enter_transition = dissolve

    ## Used when exiting the game menu to the game.

    config.exit_transition = dissolve

    ## Used between screens of the game menu.

    config.intra_transition = fade

    ## Used when entering the game menu from the main menu.

    config.main_game_transition = dissolve

    ## Used when returning to the main menu from the game.

    config.game_main_transition = dissolve

    ## Used when entering the main menu from the splashscreen.

    config.end_splash_transition = fade

    ## Used when entering the main menu after the game has ended.

    config.end_game_transition = dissolve

    ## Used when a game is loaded.

    config.after_load_transition = dissolve
And here's my code for displaying the sprites in the gallery:

Code: Select all

       g.page("Sprites")

        g.button("tnJude.png")
        g.unlock_image("jude snarky")
        g.unlock_image("jude frown")
        g.unlock_image("jude confused")
        g.unlock_image("jude neutral")
        g.unlock_image("jude off")
An easy solution would just be to create a new image where a sprite appears against a background like it would appear in the game, but I am hoping there there is a simple code solution for this instead of bogging my game directory down with a bunch more images.

Thanks!
Image
A Complete Kinetic Novel
Blog DA

Blue Lemma
Forum Founder
Posts: 2005
Joined: Sat Jan 25, 2003 2:32 pm
Completed: ToL, Shoujo Attack!, Lemma Ten
Projects: [RETIRED FROM FORUM ADMINISTRATION - CONTACT PYTOM WITH ISSUES]
Contact:

Re: Sprites in Galleries?

#2 Post by Blue Lemma »

Someone else can probably see what's going on here right away, but not me. I'm suspecting some sort of fade/dissolve mix-up, but if you can send me a zip with just the things needed to replicate, I might be able to come up with an answer.
“Among those who dislike oppression are many who like to oppress.”
- Napoleon Bonaparte


I've retired from forum administration. I do not add people to the "adult" group, deactivate accounts, nor any other administrative task. Please direct admin/mod issues to PyTom or the other mods : )

wolveski
Regular
Posts: 40
Joined: Sun Jul 26, 2009 5:06 pm
Completed: none...yet
Projects: Heavens Falls (WIP)
Location: Leeds,England
Contact:

Re: Sprites in Galleries?

#3 Post by wolveski »

if you want i can post mine but it does have a black background on charactors,so not sure if it will help much

carosene
Veteran
Posts: 342
Joined: Wed Aug 13, 2008 4:55 pm
Completed: That Cheap and Sacred Thing
Location: California
Contact:

Re: Sprites in Galleries?

#4 Post by carosene »

@wolveski
Thanks for replying. :) What are you posting? Your code?

@Blue Lemma
I attached the game to this post. I tried to grab "just the things needed to replicate," i.e. the gallery on it's own, but as you can tell, I program like a noob and I just caused more coding problems. :( So I didn't do that. Sorry!

Clicking the start button should make the Bonus button clickable, and the gallery is under the bonus button.
The whole game is in the code though. ^-^;;
If you'd like me to do something different, please let me know.
Last edited by carosene on Tue May 24, 2011 10:48 pm, edited 1 time in total.
Image
A Complete Kinetic Novel
Blog DA

Blue Lemma
Forum Founder
Posts: 2005
Joined: Sat Jan 25, 2003 2:32 pm
Completed: ToL, Shoujo Attack!, Lemma Ten
Projects: [RETIRED FROM FORUM ADMINISTRATION - CONTACT PYTOM WITH ISSUES]
Contact:

Re: Sprites in Galleries?

#5 Post by Blue Lemma »

Figured it out :)

You want to use g.image instead of g.display with your sprite gallery so you can stick an image you defined in there.
Like this:
g.image("bg nadiyashouse", "blahblahsprite.png")

And all will be good 8)
“Among those who dislike oppression are many who like to oppress.”
- Napoleon Bonaparte


I've retired from forum administration. I do not add people to the "adult" group, deactivate accounts, nor any other administrative task. Please direct admin/mod issues to PyTom or the other mods : )

carosene
Veteran
Posts: 342
Joined: Wed Aug 13, 2008 4:55 pm
Completed: That Cheap and Sacred Thing
Location: California
Contact:

Re: Sprites in Galleries?

#6 Post by carosene »

Hurray! :D That totally works. Thank you so much!
Image
A Complete Kinetic Novel
Blog DA

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]