encyclopaedia.encentry module¶
-
class
encyclopaedia.encentry.EncEntry(parent=None, number=None, name='', text='', subject='', viewed=False, viewed_persistent=False, locked=False, locked_persistent=False, image=None, locked_name='???', locked_text='???', locked_image=None, locked_image_tint=(0.0, 0.0, 0.0))[source]¶ Bases:
encyclopaedia.eventemitter.EventEmitter,renpy.store.objectStores an Entry’s content. EncEntry instances should be added to an Encyclopaedia.
Parameters: - parent (Encyclopaedia, EncEntry) –
- number (int) – The entry’s number. If this is not set then it will be given a number automatically.
- name (str) – The name that will be displayed for the entry’s button and labels.
- text (str, list) – The text that will be displayed when the entry is viewed.
- subject (str) – The subject to associate the entry with. Used for sorting and filtering.
- viewed (bool) – Determines if the entry has been seen or not. This should only be set if the Encyclopaedia is save-game independent.
- viewed_persistent (bool) – Determines if the Entry’s viewed status uses persistent data.
- locked (bool) – Determines if the entry can be viewed or not. Defaults to False.
- locked_persistent (bool) – Determines if the Entry’s locked status uses persistent data.
- image (str) – The image displayed with the Entry text. Default is None.
- locked_name (str) – Placeholder text for the name. Shown when the entry is locked.
- locked_text (str) – Placeholder text for the text. Shown when the entry is locked.
- locked_image (str) – Placeholder text for the image. Shown when the entry is locked.
- locked_image_tint (tuple) – If no specific locked image is provided, a tinted version of the image will be used. The amount of tinting can be set with RGB values in a tuple.
-
has_image¶ True if an image was provided, else False.
Type: bool
-
pages¶ Number of pages this entry contains.
Type: int
-
has_sub_entry¶ If an entry has any sub-entries.
Type: bool
-
add_entry(entry)[source]¶ Adds multiple pages to the entry in the form of sub-entries.
Parameters: entry – The entry to add as a sub-entry. Returns: True if anything was added, else False Return type: bool
-
current_page¶ Get the sub-page that’s currently viewing viewed. Setting this attribute should be done using an integer.
-
image¶ The image for the entry. Return placeholder when entry is locked.
-
label¶ name’
Type: The number and name of the entry, in the format of ‘number
-
locked¶ Determine if the entry’s data can be viewed or not. Changing this variable will modify the entry’s locked status.
-
name¶ The name for the entry. Return placeholder when entry is locked.
-
text¶ The text for the entry. Return placeholder when entry is locked.
-
viewed¶ Determines if the entry has been viewed or not. Changing this variable will modify the entry’s viewed status.
-
word_count¶ Get the word count for the EncEntry’s text.
Returns: int