Gallerynpy Properties

Gallerynpy uses multiple values accessible from gallerynpy.properties to configure and/or style the screens to be displayed. The properties that can be accessed are shown below.

Style Properties

To customize the screen where the gallery is displayed, you can do it directly in the screens.rpy file by modifying the code to your liking. But if you don’t want to make big changes, and you only want to change some styles as colours or background of the gallery, you can do this by changing the value of the following properties.

property gallerynpy.properties.font
Getter:

Gets the filepath to the font.
Used as on styles for text.

Setter:

Sets the filepath to the font

Parameters:

font – The new filepath to the font.

property gallerynpy.properties.font_size
Getter:

Gets the font size.
Used on styles for text.

Setter:

Sets the font size.

Parameters:

size – The new font size.

property gallerynpy.properties.color
Getter:

Gets the primary color.
Used on styles for text.

Setter:

Sets the primary color.

Parameters:

color – The new primary color. Must be in hexadecimal format.

property gallerynpy.properties.hover_color
Getter:

Gets the hover color.
Used on styles for text.

Setter:

Sets the hover color.

Parameters:

color – The new hover color. Must be in hexadecimal format.

property gallerynpy.properties.selected_color
Getter:

Gets the selected color.
Used on styles for text.

Setter:

Sets the selected color.

Parameters:

color – The new hover color. Must be in hexadecimal format.

property gallerynpy.properties.insensitive_color
Getter:

Gets the insensitive color.
Used on styles for text.

Setter:

Sets the insensitive color.

Parameters:

color – The new insensitive color. Must be in hexadecimal format.

property gallerynpy.properties.navigation_background
Getter:

Gets the resource navigation_background.
It is used as a displayable background for the navigation section.

Setter:

Sets the resource navigation_background.

Parameters:

displayable – The new resource for navigation_background

property gallerynpy.properties.menu_bg: Resource
Getter:

Gets the resource menu_bg.
It is used as a displayable background for the main gallerynpy screen.

Setter:

Sets the resource menu_bg.

Parameters:

displayable – The new resource for menu_bg

property gallerynpy.properties.menu: Resource
Getter:

Gets the resource menu.
It is used as a displayable for the main gallerynpy screen. It’s added after menu_bg.

Setter:

Sets the resource menu.

Parameters:

displayable – The new resource for menu

property gallerynpy.properties.spacing
Getter:

Gets the spacing between the navigation section and the items section.

Setter:

Sets the spacing between the navigation section and the items section.

Parameters:

spacing – The new spacing value. The min is 0.

property gallerynpy.properties.item_xspacing
Getter:

Gets the xspacing between each item in the items section.

Setter:

Sets the xspacing between each item in the items section.

Parameters:

xspacing – The new xspacing value. The min is 0.

property gallerynpy.properties.navigation_position
Getter:

Gets the position where the navigation section was located.

Setter:

Sets the position where the navigation section will be located.

Parameters:

position – The new position. Possible values are l or r.

property gallerynpy.properties.navigation_yalign
Getter:

Gets the yalgin value where the navigation was located.

Setter:

Sets the yalgin value where the navigation will be located.

Parameters:

yalign – The new yalign value. The min is 0 and max is 1.

property gallerynpy.properties.navigation_xsize
Getter:

Gets the current xsize (width) of the navigation section.

Setter:

Sets the current xsize (width) of the navigation section.

Parameters:

xsize – The new xsize value. The min is 80.

property gallerynpy.properties.navigation_slides_ysize
Getter:

Gets the current ysize (height) of the button section (slides names) in the navigation section.

Setter:

Sets the current ysize (height) of the button section (slides names) in the navigation section.

Parameters:

ysize – The new ysize value. The min is 40.

property gallerynpy.properties.navigation_slides_bar_position
Getter:

Gets the position where the navigation bar was located.

Setter:

Sets the position where the navigation bar will be located.

Parameters:

position – The new position. Possible values are l or r.

property gallerynpy.properties.navigation_slides_bar_xpos
Getter:

Gets the current xpos of the navigation bar in the navigation section.

Setter:

Sets the current xpos of the navigation bar in the navigation section.

Parameters:

xpos – The new xpos value. The min is 0.

property gallerynpy.properties.navigation_slides_bar_xsize
Getter:

Gets the current xsize (width) of the navigation bar in the navigation section.

Setter:

Sets the current xsize (width) of the navigation bar in the navigation section.

Parameters:

xsize – The new xsize value. The min is 5.

Item Properties

You can configure images (or viewables) for gallery item thumbnails such as blocked and image not found, or special overlays such as play icon for videos or animations.

property gallerynpy.properties.not_found: Resource
Getter:

Gets the resource not_found.
Used when a thumbnail has not been set for VIDEO or ANIMATION type items.

Setter:

Sets the resource not_found

Parameters:

displayable – The new resource for not_found

property gallerynpy.properties.locked: Resource
Getter:

Gets the resource locked.
It is used as a thumbnail on items that have not met the unlock condition they have.

Setter:

Sets the resource locked.

Parameters:

displayable – The new resource for locked

property gallerynpy.properties.idle: Resource
Getter:

Gets the resource idle.
Used as idle displayable on IMAGE or DISPLAYABLE type items.

Setter:

Sets the resource idle.

Parameters:

displayable – The new resource for idle

property gallerynpy.properties.play_idle: Resource
Getter:

Gets the resource play_idle.
Used as idle displayable in VIDEO or ANIMATION type items.

Setter:

Sets the resource play_idle.

Parameters:

displayable – The new resource for play_idle

property gallerynpy.properties.play_hover: Resource
Getter:

Sets the resource play_hover.
Used as hover displayable when is hover in VIDEO or ANIMATION type items.

Setter:

Sets the resource play_hover.

Parameters:

displayable – The new resource for play_hover

property gallerynpy.properties.thumbnails_folder
Getter:

Gets the folder where video thumbnails are stored.
This is where files for thumbnails like videpath_thumbnail.jpg will be searched.

Setter:

Sets the folder where video thumbnails are stored.

Parameters:

folder – The new folder path.

Configuration Properties

You can set some parameters to change the behavior of some functions in gallerynpy.

gallerynpy.properties.force_loader

If true, forces the Resource to load/validate when it is created. Affects only instances created internally by gallerynpy.

Default is False. Changes to true once the game has finished starting.

gallerynpy.properties.sort_slides

If true, sorts the names (keys) of each slide/slider in the current slider before displaying them as options.

Default is False.

gallerynpy.properties.keep_loaded

If true, the (displayables) elements of the gallery will be stored in the Gallery object. Otherwise, when you exit the gallerynpy screen, the reference to the Gallery object will be removed (del) to try to free up space, and it will be re-initialized when you return.

Default is False.

gallerynpy.properties.rescale_images

If true, the images will be rescaled to the size of the game screen. Trying to keep the original width / height ratio to avoid deformation.

Default is True.

gallerynpy.properties.load_in_put

If true, the (displayables) gallery items will be loaded after the start of the game. Otherwise, they will be loaded when needed.

Default is False.

gallerynpy.properties.with_speed
Getter:

Gets whether gallerynpy slides marked as animation one will display the screen with speed options

Setter:

Sets whether gallerynpy slides marked as animation one will display the screen with speed options.
It will also be saved in persistent.gallerynpy_with_speed variable.

Parameters:

value – The new value.

gallerynpy.properties.animation_speed
Getter:

Gets the current animation speed.

Setter:

Sets the current animation speed.

Parameters:

value – The new animation speed value. The min is 1.

Other Properties

There are also other properties which, although not editable, may be useful.

property gallerynpy.properties.version
Getter:

Gets the current version of Gallerynpy in string format.

property gallerynpy.properties.video_thumbnail_extensions
Getter:

Gets the thumbnail extensions accepted for automatically loading video element extensions.
e.g. _thumbnail.jpg.