Skip to content

A Ren'Py tool that emulates a terminal / command line.

License

Notifications You must be signed in to change notification settings

Elckarow/Console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Console

A Ren'Py tool that emulates a terminal / command line.

image

Terms of Usage

You must credit me as elckarow, via either a link to the repo or to my itch page.

Documentation

Every variables and functions described below are defined in the console namespace.

  • HISTORY_LENGTH = 20

How many console entries we save.

  • enter_transition = Dissolve(0.3)

The default transition used when showing the console.

  • exit_transition = Dissolve(0.3)

The default transition used when hiding the console.

  • def show(transition=enter_transition, delay=0.4)

Shows the console. Pauses for delay seconds after (delay=None will wait for user input, while delay=-1 won't pause at all).

  • def hide(transition=enter_transition, delay=0.4)

Hides the console.

  • def input(text, delay=-1, cps=30, output_entry=None)

Adds an input text to the console, which is displayed with a cps of cps (None means instant display). If output_entry is not None, it is either a string, or True (which will take text for value). Will add the string as an output before the function returns.

image

  • def output(text, delay=None, cps=None)

Adds an output text to the console.

image

  • def interact(delay=-1, input_entry=None, empty=True, run=False, **kwargs)

Prompts the player for an input, which is then returned. If empty is true, the string won't be returned as long as it is empty. This also takes the following parameters; length, allow, exclude, prefix, suffix, multiline, copypaste and mask; as described for the input screen language statement. If run is true, the inputed string will be passed to subprocess.run, and the returned value from that call will be returned, or None if an exception was raised.

  • def clean_history()

Pops the console history until its length is less than HISTORY_LENGTH.

  • def clear_history()

Clears the console.

About

A Ren'Py tool that emulates a terminal / command line.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages