lucia package¶
Subpackages¶
Submodules¶
lucia.data module¶
Provides functions for easily manipulating textual or binary data. Currently includes encryption and compression.
-
lucia.data.
compress
(data, algorithm=1, compression_level=6)¶
-
lucia.data.
decompress
(data, algorithm=1)¶
-
lucia.data.
decrypt
(data, key)¶
-
lucia.data.
encrypt
(data, key)¶
-
exception
lucia.data.
unsupportedAlgorithm
¶ Bases:
Exception
raised when the user tries supplying an algorithm not specified in constants
lucia.output module¶
-
lucia.output.
output
= <accessible_output2.outputs.auto.Auto object>¶ Functions: get_first_available_output() - autoselects the first available output. speak(text, interrupt=False) - speaks some text. silence() - Silence the current output if speaking. braille(text, **options) - braills some output. output(text, *args) - Both speak and braille some text. is_active() - checks if the given output is active.
lucia.packfile module¶
Lucia’s resource pack module
This module will aid in the interaction with and creation of data files for storing game assets. A lucia resource file is a binary file format with the ability to have encryption and/or compression instituted on a per-file basis at creation time. Using the get method one may retrieve the contents of any file added to the pack, for example to be used in a memory load function of a sound system.
-
exception
lucia.packfile.
InvalidPackHeader
¶ Bases:
Exception
raised when the packs header is invalid
-
class
lucia.packfile.
ResourceFile
(key, header=b'LURF', version=1)¶ Bases:
object
The resource file object
You will interact with resource files through methods provided by this object. This object may have any number of instances, however only one instance should interact with a given file on the file system at a time.
-
add_file
(name, compress=True, encrypt=True, internalname=None)¶ Adds a file on disk to the pack, optionally compressing and/or encrypting it.
:param : param name: The file name to read from. :param : param compress (boolean, optional): Whether compression should be applied to this file. Defaults to True. :param : param encrypt (boolean, optional): Whether encryption should be applied to this file. Defaults to True. :param : param internalname (optional): Internal file name to be used inside the pack. If None, the default, internal name will be same as name on disk.
-
add_memory
(name, content, compress=True, encrypt=True)¶
-
exist
(name)¶
-
get
(name)¶
-
list
()¶
-
load
(filename)¶ Opens a resource file to be read.
- This file will be checked for validity based on matching header, version, and a non-0 number of files. If one of these conditions fails, InvalidPackHeader will be raised. Otherwise this object will be loaded with the contents.
- param filename
The file name to be read from the file system.
-
save
(filename)¶ Saves data added to this object to a resource file.
When creating a resource file, this is the final method you would call. :param : param filename: The file name on disk to write to. Will be overwritten if already exists.
-
-
class
lucia.packfile.
ResourceFileItem
(name, content, compress, encrypt)¶ Bases:
object
Internal object representing an item in the pack.
Module contents¶
The main Lucia module
The functions here are responsible for initializing and quitting lucia, showing the game window, handle global events and so on. In addition, this part of lucia also contains must keyboard functions.
-
exception
lucia.
AudioBackendException
¶ Bases:
ValueError
-
lucia.
get_global_resource_file
()¶
-
lucia.
initialize
(audiobackend=0)¶ Initialize lucia and the underlying graphic, audio, keyboard, interface engines
-
lucia.
key_down
(key_code)¶ Checks if a key is beeing held down. * key_code: a pygame.K_ key code
returns: True if the specified key kode is beeing held down, False otherwise.
-
lucia.
key_pressed
(key_code)¶ Checks if a key was pressed down this frame (single key press) * key_code: a pygame.K_ key code
returns: True if the specified key kode was pressed, False otherwise.
-
lucia.
key_released
(key_code)¶ Checks if a key was released down this frame (single key release) * key_code: pygame.K_ key code
returns: True if the specified key kode was released, False otherwise.
-
lucia.
key_up
(key_code)¶ Check if a key isn’t beeing held down (ie if it’s not pressed and held) key_code : An pygame.K_ key code
returns: True if key is not held down, False otherwise
-
lucia.
process_events
()¶ This processes events for the window This should be called in any loop, to insure that the window and application stays responsive
-
lucia.
quit
()¶ Shutdown lucia and close underlying engines freeing up system resources
-
lucia.
set_global_resource_file
(file)¶
-
lucia.
show_window
(title='LuciaGame', size=(640, 480))¶ Shows the main game window on the screen, this is most likely called at the start of a game