Gallery Related Functions
For the insertion or creation of gallery items and other functions, gallerynpy provides some common methods for this.
For other methods and related attributes, see handler
.
- gallerynpy.put_item(where: str, resource, thumbnail=None, song: str = None, condition: str = None, tooltip: str = None, for_animation_slide: bool = False)
Creates a new item and put it into the gallerynpy gallery.
- Parameters:
where – The name of the slide to put the item into
resource – The item resource
thumbnail – The item custom thumbnail resource.
song – A valid filepath for an audio that renpy can load.
condition – The condition to unlock the item.
tooltip – The tooltip text to display when the item is hovered.
for_animation_slide – If true and the slide with the given name has not yet been created, the slide is marked as one for animations.
- gallerynpy.create_item(resource, thumbnail=None, song: str = None, condition: str = None, tooltip: str = None)
Creates an item with the given params.
- Parameters:
resource – The item resource
thumbnail – The item custom thumbnail resource.
song – A valid filepath for an audio that renpy can load.
condition – The condition to unlock the item.
tooltip – The tooltip text to display when the item is hovered.
- Returns:
The created item.
- Raises:
ValueError – If the given resource is None.
- gallerynpy.rows()
Gets the maximum number of rows on each page of each slide.
- gallerynpy.cols()
Gets the maximum number of columns on each page of each slide.
- gallerynpy.distribution()
Gets the current distribution on each page.
- Returns:
A tuple containing the (cols, rows) values
- gallerynpy.change_distribution(rows: int = None, columns: int = None)
Changes the distribution on each page of each slide.
- Parameters:
columns – The number of columns in the page.
rows – The number of rows in the page.
- gallerynpy.custom_name_for(slide_name: str, new_name: str)
Sets a custom name for the slides or sliders with the given name.
- Parameters:
slide_name – The name of the slides or sliders
new_name – The custom name
- gallerynpy.name_for(name: str)
Gets the name for the sliders or slides with the given name.
- Parameters:
name – The name of the slides or sliders
- Returns:
The custom name if it exists, otherwise the capitalized name.
- gallerynpy.tooltip()
Gets the current tooltip.
- gallerynpy.content_slides()
Gets the name of all slides that have at least one item into.
- gallerynpy.page_buttons()
Gets all buttons for the current page items on the current slide.
- gallerynpy.next_page()
Gets the action to switch to the next page on the current slide.
- Returns:
The action to change the page, or None if the current page number is the last.
- gallerynpy.previous_page()
Gets the action to switch to the previous page on the current slide. The action to change the page, or None if the current page number is the first
- gallerynpy.back(from_animation_options=False)
Gets the action to return to the menu since gallerynpy was called or to navigate between sliders.
- Parameters:
from_animation_options – If true, and the current slide is for animations, it means that it must return to the first valid slide of the current slider
- Returns:
The action to return or navigate.
- gallerynpy.is_current(name: str)
Checks if the given name is equal to the currently selected name.
- Parameters:
name – The name of the slide, or slide, to check.
- Returns:
True if the name is equal to the currently selected, False otherwise.
- gallerynpy.is_for_animations()
Checks if the current slide is one for animations
- Returns:
True if the current slide is one for animations, False otherwise
- gallerynpy.create_slide(name, is_animation_slide=False)
Create a slide with the given name and the base slider as its parent.
- Parameters:
name – The slide name
is_animation_slide – Sets true if the slide will be marked as one for animations
- Returns:
The created slide.
- gallerynpy.put_slide_like(slide: Slide | Slider, *args: Slide | Slider)
Adds the given slide or slider to the base slider and all its items to the gallerynpy gallery.
- Parameters:
slide – The slide or slider to add
args – Other slides or sliders to add
- gallerynpy.scale(resource)
Scales the given resource according to the current thumbnail size.
- Parameters:
resource – The resource to scale
- gallerynpy.change_transition(transition)
Changes the current transition of the gallerynpy gallery.
- Parameters:
transition – Changes the current transition of the gallerynpy gallery.
- gallerynpy.animation_speed()
Gets the current animation speed.
A shortcut to
animation_speed
.
- gallerynpy.put_video(filename: str | Resource, where: str = None, thumbnail=None, song=None, condition=None, tooltip=None)
Deprecated. Use
put_item()
instead.
- gallerynpy.put_image(image, where: str = None, song: str = None, condition: str = None, tooltip: str = None, thumbnail_resource=None)
Deprecated. Use
put_item()
instead.
- gallerynpy.put_animation(animation_name: str | Resource, thumbnail_name=None, where=None, song=None, condition=None, is_animation_slide=True, tooltip=None)
Deprecated. Use
put_item()
instead.
- gallerynpy.create_video(filename, thumbnail=None, song=None, condition=None, tooltip=None)
Deprecated. Use
create_item()
instead.
- gallerynpy.create_image(image, song: str = None, condition: str = None, tooltip: str = None, thumbnail_resource=None)
Deprecated. Use
create_item()
instead.
- gallerynpy.create_animation(atl_object, thumbnail_name, song=None, condition=None, tooltip=None)
Deprecated. Use
create_item()
instead.
- gallerynpy.put_slider(slider: Slide | Slider)
Deprecated. Use
put_slide_like()
instead.