buttons with transparent areas shown as white

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
oskigrn
Newbie
Posts: 9
Joined: Thu Aug 23, 2018 1:03 pm
Contact:

buttons with transparent areas shown as white

#1 Post by oskigrn »

Hi everyone, newbie here,

I have a couple issues with a very simple map screen with imagebuttons. I'm using some PNG images (home and school with their idle and hover versions) with transparent areas but those areas are shown as white background instead of transparent. I've been searching on documentation and I've haven't found what I'm doing wrong.

The second issue is the focus_mask Displayable line crashes me the game, don't know why either.

This is the code, thanks for answering.

Code: Select all

screen shinjuku:
    zorder 90
    modal True
    image "#000000"
    image "tokyo shinjuku bg" alpha .7
    textbutton "< BACK":
        xalign 0.5 yalign 1.0
        style "top_menu_button"
        hovered Notify(_("Go back"))
        unhovered Hide('notify')
        action Hide("shinjuku")
    imagebutton:
        xalign 0.28 yalign 0.72
        idle "home idle"
        hover "home hover"
        insensitive "home idle"
        hovered Notify(_("Go home"))
        unhovered Hide('notify')
        # focus_mask Displayable
        action None
    imagebutton:
        xalign 0.2 yalign 0.6
        idle "school idle"
        hover "school hover"
        insensitive "school idle"
        hovered Notify(_("Go to school"))
        unhovered Hide('notify')
        # focus_mask Displayable
        action None
Last edited by oskigrn on Thu Aug 23, 2018 4:49 pm, edited 2 times in total.

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: buttons with transparent areas shown as white

#2 Post by mitoky »

First make sure the images are actually transparent (you might have done this already, but just in case since you can save white background with the files accidently in image programs)

For the focus_mask i have never heared of "Displayable" or seen it used, but from the docs "focus_mask True" whould have the same use i suppose? maybe try this instead!

oskigrn
Newbie
Posts: 9
Joined: Thu Aug 23, 2018 1:03 pm
Contact:

Re: buttons with transparent areas shown as white

#3 Post by oskigrn »

Ok... Sure I checked all the images twice before posting, but in the wrong folder... so, point for me :D

The focus_mask is not a big deal... Is just was wondering what diferences are between the diferent options there are in renpy documentation:

focus_mask - multiple

A mask that's used to control what portions of the button can be focused, and hence clicked on. The type of this property determines how it is interpreted.

Displayable
The areas of the displayable that are not transparent cause the button to be focused.
True
The button itself is used as the displayable (so non-transparent areas of the button cause the button to be focused).
callable
If a non-displayable callable (like a function, method, or object with a __call__ method) is given, the function is called with two arguments, the x and y offset from the top-left corner of the displayable. If the function returns True, the displayable is focused.
None
If none is given, the entire button can be focused.


Thanks for answering anyway!

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: buttons with transparent areas shown as white

#4 Post by MaydohMaydoh »

Displayable takes an actual displayable, like an image, separate from the button images and uses its transparency to determine what parts of the button can be focused with the cursor. True does the same thing only it uses the button images to do this.

Post Reply

Who is online

Users browsing this forum: No registered users