sphinx-quickstart on Mon Feb 19 11:33:00 2018. You can adapt this file completely to your liking, but it should at least contain the root toctree directive.

ELiDE

The graphical interface, ELiDE, lets the developer change whatever they want about the world. A game made with ELiDE will be more restrictive about what the player is allowed to change, but all of the player’s input will be turned into changes to the world, which the rules may respond to however they need.

ELiDE has three columns. On the right are a lot of buttons to access the parts of ELiDE that aren’t visible right now, plus a couple of icons that you can drag into the middle. In the middle, you have a graphical display of the Character under consideration; dragging those icons here will make a new Place or Thing. To connect Places with Portals, press the button with the arrow on it, then drag from one Place to another. Press the button again when you’re done. On the left is the stat editor: it displays data that is stored in whatever entity is presently selected. You can select Places, Things, and Portals by clicking them–and once you’ve selected them, you can drag them elsewhere. If no Place, Thing, or Portal is selected, then the Character you are viewing is selected. There’s a button in the top-right to view another Character.

On the bottom left are some bits to let you manipulate time, mainly the Simulate and 1 Turn buttons. Simulate will start moving time forward when you press it, and stop when you press it again. There are also text fields with which you can enter the time by hand. Note that rules are only run when you advance time using Simulate or 1 Turn. The Tick field indicates how many changes have occurred in the current turn.

game

Tools to make it easier to script your own game using the ELiDE widgets.

class ELiDE.game.GameApp(**kwargs)[source]
build()[source]

Initializes the application; it will be called only once. If this method returns a widget (tree), it will be used as the root widget and added to the window.

Returns:

None or a root Widget instance if no self.root exists.

next_turn(*args)[source]

Smoothly advance to the next turn in the simulation

This uses a subthread to wait for LiSE to finish simulating the turn and report the changes. The interface will remain responsive.

If you’re wiring up the interface, consider binding user input to trigger_next_turn instead, so that the user doesn’t mistakenly go two or three turns into the future.

on_pause()[source]

Sync the database with the current state of the game.

on_stop(*largs)[source]

Sync the database, wrap up the game, and halt.

wait_command(start_func, turns=1, end_func=None)[source]

Call start_func, and wait to call end_func after simulating turns (default 1)

Parameters:
  • start_func – function to call before waiting

  • turns – number of turns to wait

  • end_func – function to call after waiting

Returns:

None

wait_travel(character, thing, dest, cb=None)[source]

Schedule a thing to travel someplace, then wait for it to finish, and call cb if provided

Parameters:
  • character – name of the character

  • thing – name of the thing

  • dest – name of the destination (a place)

  • cb – function to be called when I’m done

Returns:

None

wait_travel_command(character, thing, dest, start_func, turns=1, end_func=None)[source]

Schedule a thing to travel someplace and do something, then wait for it to finish.

Parameters:
  • character – name of the character

  • thing – name of the thing

  • dest – name of the destination (a place)

  • start_func – function to call when the thing gets to dest

  • turns – number of turns to wait after start_func before re-enabling input

  • end_func – optional. Function to call after waiting turns after start_func

Returns:

None

wait_turns(turns, *, cb=None)[source]

Call self.engine.next_turn() turns times, waiting self.turn_length in between

If provided, call cb when done.

Parameters:
  • turns – number of turns to wait

  • dt – unused, just satisfies the clock

  • cb – callback function to call when done, optional

Returns:

None

class ELiDE.game.GameScreen(**kw)[source]
disable_input(cb=None)[source]

Set self.disabled to True, then call cb if provided

Parameters:

cb – callback function for after disabling

Returns:

None

disabled

If you bind your widgets’ disabled to this, they will be disabled when a game command is in mid-execution

enable_input(cb=None)[source]

Call cb if provided, then set self.disabled to False

Parameters:

cb – callback function for before enabling

Returns:

None

switch_screen

Method to set the screen attribute of the main kivy.uix.screenmanager.ScreenManager

wait_command(start_func, turns=1, end_func=None)[source]

Call start_func, wait turns, and then call end_func if provided

Disables input for the duration.

Parameters:
  • start_func – function to call just after disabling input

  • turns – number of turns to wait

  • end_func – function to call just before re-enabling input

Returns:

None

wait_travel(character, thing, dest, cb=None)[source]

Schedule a thing to travel someplace, then wait for it to finish.

Parameters:
  • character – name of the character

  • thing – name of the thing that will travel

  • dest – name of the place it will travel to

  • cb – callback function for when it’s done, optional

Returns:

None

wait_travel_command(character, thing, dest, start_func, turns=1, end_func=<function GameScreen.<lambda>>)[source]

Schedule a thing to travel someplace and do something, then wait for it to finish.

Input will be disabled for the duration.

Parameters:
  • character – name of the character

  • thing – name of the thing

  • dest – name of the destination (a place)

  • start_func – function to call when the thing gets to dest

  • turns – number of turns to wait after start_func before re-enabling input

  • end_func – optional. Function to call after waiting turns after start_func

Returns:

None

wait_turns(turns, cb=None)[source]

Call self.app.engine.next_turn() n times, waiting self.app.turn_length in between

Disables input for the duration.

Parameters:
  • turns – number of turns to wait

  • cb – function to call when done waiting, optional

Returns:

None

graph

The default view on the state of the world.

board

The big widget that shows the graph of the selected Character.

class ELiDE.graph.board.FinalLayout(**kwargs)[source]
class ELiDE.graph.board.GraphBoard(**kw)[source]

A graphical view onto a LiSE.Character, resembling a game graph.

arrows()[source]

Iterate over all my arrows.

arrows_at(x, y)[source]

Iterate over arrows that collide the given point.

make_pawn(thing)[source]

Make a Pawn to represent a Thing, store it, and return a dict suitable for StackPlane.add_datum

make_spot(place)[source]

Make a Spot to represent a Place, store it, and return a dict suitable for StackPlane.add_datum

on_parent(*args)[source]

Create some subwidgets and trigger the first update.

on_touch_down(touch)[source]

Check for collisions and select an appropriate entity.

on_touch_move(touch)[source]

If an entity is selected, drag it.

on_touch_up(touch)[source]

Delegate touch handling if possible, else select something.

pawns_at(x, y)[source]

Iterate over pawns that collide the given point.

portal_touch_up(touch)[source]

Try to create a portal between the spots the user chose.

rm_arrow(orig, dest, *args)[source]

Remove the Arrow that goes from orig to dest.

rm_pawn(name, *args)[source]

Remove the Pawn by the given name.

rm_spot(name, *args)[source]

Remove the Spot by the given name.

spots_at(x, y)[source]

Iterate over spots that collide the given point.

update(*args)[source]

Force an update to match the current state of my character.

This polls every element of the character, and therefore causes me to sync with the LiSE core for a long time. Avoid when possible.

update_arrow_display()[source]

Change arrow graphics to match the state of their portal

update_from_delta(delta, *args)[source]

Apply the changes described in the dict delta.

update_pawn_display()[source]

Change pawn graphics to match the state of their thing

update_spot_display()[source]

Change spot graphics to match the state of their place

class ELiDE.graph.board.GraphBoardScatterPlane(**kwargs)[source]
pawn_from_dummy(dummy)[source]

Make a real thing and its pawn from a dummy pawn.

Create a new graph.Pawn instance, along with the underlying LiSE.Thing instance, and give it the name, location, and imagery of the provided dummy.

spot_from_dummy(dummy)[source]

Make a real place and its spot from a dummy spot.

Create a new graph.Spot instance, along with the underlying LiSE.Place instance, and give it the name, position, and imagery of the provided dummy.

class ELiDE.graph.board.GraphBoardView(**kwargs)[source]
class ELiDE.graph.board.KvLayoutBack(**kwargs)[source]

What to show behind the graph.

By default, shows nothing.

class ELiDE.graph.board.KvLayoutFront(**kwargs)[source]

What to show in front of the graph.

By default, shows nothing.

pawn

Representations of Things

Widget representing things that move about from place to place.

class ELiDE.graph.pawn.Pawn(**kwargs)[source]

A token to represent a Thing.

Thing is the LiSE class to represent items that are located in some Place or other. Accordingly, Pawn’s coordinates are never set directly; they are instead derived from the location of the Thing represented. That means a Pawn will appear next to the Spot representing the Place that its Thing is in. The exception is if the Thing is currently moving from its current Place to another one, in which case the Pawn will appear some distance along the Arrow that represents the Portal it’s moving through.

spot

Representations of Places

Widget to represent Place`s. :class:`Pawn moves around on top of these.

class ELiDE.graph.spot.GraphSpot(**kwargs)[source]

The icon that represents a Place.

Each Spot is located on the Board that represents the Character that the underlying Place is in. Its coordinates are relative to its Board, not necessarily the window the Board is in.

finalize(initial=True)[source]

Call this after you’ve created all the PawnSpot you need and are ready to add them to the board.

on_pos(*args)[source]

Translate all the rectangles within this widget to reflect the widget’s position.

on_touch_up(touch)[source]

Receive a touch up event. The touch is in parent coordinates.

See on_touch_down() for more information.

push_pos(*args)[source]

Set my current position, expressed as proportions of the graph’s width and height, into the _x and _y keys of the entity in my proxy property, such that it will be recorded in the database.

arrow

Representations of directed edges

That which displays a one-way connection between two places.

An arrow connects two spots, the origin and the destination, and it points from the origin to the destination, regardless of where on the screen they are at the moment.

class ELiDE.graph.arrow.ArrowPlane(**kwargs)[source]
class ELiDE.graph.arrow.GraphArrowWidget(**kwargs)[source]
ELiDE.graph.arrow.get_points(orig, dest, taillen)[source]

Return a pair of lists of points for use making an arrow.

The first list is the beginning and end point of the trunk of the arrow.

The second list is the arrowhead.

ELiDE.graph.arrow.get_points_multi(args)[source]

Return a dictionary mapping (orig, dest) to pairs of point lists for arrows

Takes an iterable of (orig, dest, taillen) where orig and dest are Spot instances

taillen is an integer specifying how long the arrowhead should be.

grid

Alternate board view for graphs that are shaped like grids

class ELiDE.grid.board.GridBoard(**kwargs)[source]
on_touch_down(touch)[source]

Receive a touch down event.

Parameters:
touch: MotionEvent class

Touch received. The touch is in parent coordinates. See relativelayout for a discussion on coordinate systems.

Returns:

bool If True, the dispatching of the touch event will stop. If False, the event will continue to be dispatched to the rest of the widget tree.

on_touch_up(touch)[source]

Receive a touch up event. The touch is in parent coordinates.

See on_touch_down() for more information.

class ELiDE.grid.board.GridBoardScatterPlane(**kwargs)[source]
class ELiDE.grid.board.GridBoardView(**kwargs)[source]

screen

The big layout that you view all of ELiDE through.

Handles touch, selection, and time control. Contains a graph, a stat grid, the time control panel, and the menu.

class ELiDE.screen.CharMenuContainer(**kwargs)[source]
class ELiDE.screen.KvLayout(**kwargs)[source]
class ELiDE.screen.MainScreen(**kw)[source]

A master layout that contains one graph and some menus.

This contains three elements: a scrollview (containing the graph), a menu, and the time control panel. This class has some support methods for handling interactions with the menu and the character sheet, but if neither of those happen, the scrollview handles touches on its own.

manager

ScreenManager object, set when the screen is added to a manager.

manager is an ObjectProperty and defaults to None, read-only.

next_turn(cb=None, *args)[source]

Advance time by one turn, if it’s not blocked.

Block time by setting engine.universal['block'] = True

on_dummies(*args)[source]

Give the dummies numbers such that, when appended to their names, they give a unique name for the resulting new graph.Pawn or graph.Spot.

on_play_speed(*args)[source]

Change the interval at which self.play is called to match my current play_speed.

on_touch_down(touch)[source]

Receive a touch down event.

Parameters:
touch: MotionEvent class

Touch received. The touch is in parent coordinates. See relativelayout for a discussion on coordinate systems.

Returns:

bool If True, the dispatching of the touch event will stop. If False, the event will continue to be dispatched to the rest of the widget tree.

on_touch_up(touch)[source]

Receive a touch up event. The touch is in parent coordinates.

See on_touch_down() for more information.

play(*args)[source]

If the ‘play’ button is pressed, advance a turn.

If you want to disable this, set engine.universal['block'] = True

remake_display(*args)[source]

Remake any affected widgets after a change in my kv.

class ELiDE.screen.OneTurnButton(**kwargs)[source]
class ELiDE.screen.SimulateButton(**kwargs)[source]
class ELiDE.screen.StatListPanel(**kwargs)[source]

A panel that displays a simple two-column grid showing the stats of the selected entity, defaulting to those of the character being viewed.

Has a button on the bottom to open the StatWindow in which to add and delete stats, or to change the way they are displayed in the StatListPanel.

class ELiDE.screen.TimePanel(**kwargs)[source]

A panel that lets you to start and stop the game, or browse through its history.

There’s a “simulate” button, which is toggleable. When toggled on, the simulation will continue to run until it’s toggled off again. Next to this is a “1 turn” button, which will simulate exactly one turn and stop. And there are two text fields in which you can manually enter a Branch and Tick to go to. Moving through time this way doesn’t simulate anything–you’ll only see what happened as a result of “simulate,” “1 turn,” or some other way the LiSE rules engine has been made to run.

class ELiDE.screen.TurnScroll(**kwargs)[source]
on_touch_move(touch)[source]

Receive a touch move event. The touch is in parent coordinates.

See on_touch_down() for more information.

on_touch_up(touch)[source]

Receive a touch up event. The touch is in parent coordinates.

See on_touch_down() for more information.

card

The widget used to represent functions in the rules editor

Widget that looks like a trading card, and a layout within which it can be dragged and dropped to some particular position within stacks of other cards.

class ELiDE.card.Card(**kwargs)[source]

A trading card with text and illustration

Its appearance is determined by several properties, the most important being:

  • headline_text, a string to be shown at the top of the card; may be styled with eg. headline_font_name or headline_color

  • art_source, the path to an image to be displayed below the headline; may be hidden by setting show_art to False

  • midline_text, similar to headline_text but appearing below the art

  • text, shown in a box the same size as the art. Styleable like headline_text and you can customize the box with eg. foreground_color and foreground_source

  • footer_text, like headline_text but at the bottom

Card is particularly useful when put in a DeckLayout, allowing the user to drag cards in between any number of piles, into particular positions within a particular pile, and so forth.

copy()[source]

Return a new Card just like me.

on_art_image(*args)[source]

When I get a new art_image, store its texture in art_texture.

on_art_source(*args)[source]

When I get a new art_source, load it as an Image and store that in art_image.

on_background_image(*args)[source]

When I get a new background_image, store its texture in background_texture.

on_background_source(*args)[source]

When I get a new background_source, load it as an Image and store that in background_image.

on_foreground_image(*args)[source]

When I get a new foreground_image, store its texture in my foreground_texture.

on_foreground_source(*args)[source]

When I get a new foreground_source, load it as an Image and store that in foreground_image.

on_touch_down(touch)[source]

If I’m the first card to collide this touch, grab it, store my metadata in its userdict, and store the relative coords upon me where the collision happened.

on_touch_move(touch)[source]

If I’m being dragged, move so as to be always positioned the same relative to the touch.

on_touch_up(touch)[source]

Stop dragging if needed.

class ELiDE.card.ColorTextureBox(**kwargs)[source]

A box, with a background of one solid color, an outline of another color, and possibly a texture covering the background.

class ELiDE.card.DeckBuilderLayout(**kwargs)[source]

Sizes and positions Card objects based on their order within decks, a list of lists where each sublist is a deck of cards.

card_hint_step

An offset, expressed in proportion to my size, applied to each successive card in a given deck.

card_size_hint

Size hint of cards, relative to my size.

card_size_hint_x

Each card’s width, expressed as a proportion of my width.

card_size_hint_y

Each card’s height, expressed as a proportion of my height.

card_x_hint_step

Each time I put another card on a deck, I’ll move it this much of my width to the right of the previous card.

card_y_hint_step

Each time I put another card on a deck, I’ll move it this much of my height above the previous card.

deck_hint_step

Offset of each deck with respect to the previous, as a proportion of my size.

deck_x_hint_offsets

An additional proportional x-offset for each deck, defaulting to 0.

deck_x_hint_step

When I start a new deck, it will be this far to the right of the previous deck, expressed as a proportion of my width.

deck_y_hint_offsets

An additional proportional y-offset for each deck, defaulting to 0.

deck_y_hint_step

When I start a new deck, it will be this far above the previous deck, expressed as a proportion of my height.

decks

Put a list of lists of Card objects here and I’ll position them appropriately. Please don’t use add_widget.

direction

Should the beginning card of each deck appear on the bottom (‘ascending’), or the top (‘descending’)?

do_layout(*args)[source]

Layout each of my decks

foundation_color

Color to use for the outline showing where a deck is when it’s empty.

insertion_card

Index within the current deck that a card is being dragged into.

insertion_deck

Index of the deck that a card is being dragged into.

layout_deck(i)[source]

Stack the cards, starting at my deck’s foundation, and proceeding by card_pos_hint

on_decks(*args)[source]

Inform the cards of their deck and their index within the deck; extend the _hint_offsets properties as needed; and trigger a layout.

on_insertion_card(*args)[source]

Trigger a layout

on_touch_move(touch)[source]

If a card is being dragged, move other cards out of the way to show where the dragged card will go if you drop it.

on_touch_up(touch)[source]

If a card is being dragged, put it in the place it was just dropped and trigger a layout.

point_after_card(card, x, y)[source]

Return whether (x, y) is somewhere after card, given how I know cards to be arranged.

If the cards are being stacked down and to the right, that means I’m testing whether (x, y) is below or to the left of card.

point_before_card(card, x, y)[source]

Return whether (x, y) is somewhere before card, given how I know cards to be arranged.

If the cards are being stacked down and to the right, that means I’m testing whether (x, y) is above or to the left of the card.

scroll_deck(decknum, scroll_x, scroll_y)[source]

Move a deck.

scroll_deck_x(decknum, scroll_x)[source]

Move a deck left or right.

scroll_deck_y(decknum, scroll_y)[source]

Move a deck up or down.

starting_pos_hint

Pos hint at which to place the initial card of the initial deck.

class ELiDE.card.DeckBuilderScrollBar(**kwargs)[source]

A widget that looks a lot like one of the scrollbars on the sides of eg. kivy.uix.ScrollView, which moves a single deck within a DeckBuilderLayout.

bar_color

Color to use for the scroll bar when scrolling. RGBA format.

bar_inactive_color

Color to use for the scroll bar when not scrolling. RGBA format.

bar_texture

Texture for the scroll bar, normally None.

bar_touched(bar, touch)[source]

Start scrolling, and record where I started scrolling.

deckbuilder

The DeckBuilderLayout of the deck to scroll.

deckidx

The index of the deck to scroll, within its DeckBuilderLayout’s decks property.

do_layout(*args)[source]

Put the bar where it’s supposed to be, and size it in proportion to the size of the scrollable area.

handle_scroll(*args)[source]

When my scroll changes, tell my deckbuilder how it’s scrolled now.

hbar

A tuple of (x, width) for my scroll bar, if it’s horizontal.

on_deckbuilder(*args)[source]

Bind my deckbuilder to update my scroll, and my scroll to update my deckbuilder.

on_touch_move(touch)[source]

Move the scrollbar to the touch, and update my scroll accordingly.

on_touch_up(touch)[source]

Stop scrolling.

orientation

Which way to scroll? Options are ‘horizontal’ and ‘vertical’.

scroll

A number between 0 and 1 representing how far beyond scroll_min toward scroll_max I am presently scrolled.

scroll_hint

The distance between scroll_max and scroll_min.

scroll_max

How far right (if horizontal) or up (if vertical) I can move my deck, expressed as a proportion of the DeckBuilderLayout’s width or height, respectively.

scroll_min

How far left (if horizontal) or down (if vertical) I can move my deck, expressed as a proportion of the DeckBuilderLayout’s width or height, respectively.

scrolling

Has the user grabbed me?

upd_scroll(*args)[source]

Update my own scroll property to where my deck is actually scrolled.

vbar

A tuple of (y, height) for my scroll bar, if it’s vertical.

class ELiDE.card.DeckBuilderView(**kwargs)[source]

Just a DeckBuilderLayout mixed with StencilView.

class ELiDE.card.Foundation(**kwargs)[source]

An empty outline to indicate where a deck is when there are no cards in it.

color

Color of the outline

deck

Index of the deck in the parent DeckLayout

upd_pos(*args)[source]

Ask the foundation where I should be, based on what deck I’m for.

upd_size(*args)[source]

I’m the same size as any given card in my DeckLayout.

class ELiDE.card.ScrollBarBar(**kwargs)[source]

Tiny tweak to ColorTextureBox to make it work within DeckBuilderScrollBar

on_touch_down(touch)[source]

Tell my parent if I’ve been touched

ELiDE.card.get_pos_hint(poshints, sizehintx, sizehinty)[source]

Return a tuple of (pos_hint_x, pos_hint_y) even if neither of those keys are present in the provided poshints – they can be computed using the available keys together with size_hint_x and size_hint_y.

ELiDE.card.get_pos_hint_x(poshints, sizehintx)[source]

Return poshints['x'] if available, or its computed equivalent otherwise.

ELiDE.card.get_pos_hint_y(poshints, sizehinty)[source]

Return poshints['y'] if available, or its computed equivalent otherwise.

charmenu

The menu along the right side of the screen, where you can add things to the character

class ELiDE.charmenu.CharMenu(**kwargs)[source]
toggle_chars_screen(*args)[source]

Display or hide the list you use to switch between characters.

toggle_funcs_editor()[source]

Display or hide the text editing window for functions.

toggle_pawn_cfg()[source]

Show or hide the pop-over where you can configure the dummy pawn

toggle_reciprocal()[source]

Flip my reciprocal_portal boolean, and draw (or stop drawing) an extra arrow on the appropriate button to indicate the fact.

toggle_rules(*args)[source]

Display or hide the view for constructing rules out of cards.

toggle_spot_cfg()[source]

Show the dialog where you select graphics and a name for a place, or hide it if already showing.

charsview

Menu for selecting which Character to work on

class ELiDE.charsview.CharactersRecycleBoxLayout(**kwargs)[source]
apply_selection(index, view, is_selected)[source]

Applies the selection to the view. This is called internally when a view is displayed and it needs to be shown as selected or as not selected.

It is called when select_node() or deselect_node() is called or when a view needs to be refreshed. Its function is purely to update the view to reflect the selection state. So the function may be called multiple times even if the selection state may not have changed.

If the view is a instance of RecycleDataViewBehavior, its apply_selection() method will be called every time the view needs to refresh the selection state. Otherwise, the this method is responsible for applying the selection.

Parameters:
index: int

The index of the data item that is associated with the view.

view: widget

The widget that is the view of this data item.

is_selected: bool

Whether the item is selected.

class ELiDE.charsview.CharactersScreen(**kw)[source]
class ELiDE.charsview.CharactersView(**kwargs)[source]

dialog

Simple data-driven UI interactions

Generic dialog boxes and menus, for in front of a Board

class ELiDE.dialog.Box(**kwargs)[source]
class ELiDE.dialog.Dialog(**kwargs)[source]

MessageBox with a DialogMenu beneath it.

Set the properties message_kwargs and menu_kwargs, respectively, to control them – but you probably want to do that by returning a pair of dicts from an action in LiSE.

class ELiDE.dialog.DialogLayout(**kwargs)[source]

A layout, normally empty, that can generate dialogs

To make dialogs, set my todo property to a list. It may contain:

  • Strings, which will be displayed with an “OK” button to dismiss them

  • Lists of pairs of strings and callables, which generate buttons with the string on them that, when clicked, call the callable

  • Lists of pairs of dictionaries, which are interpreted as keyword arguments to MessageBox and DialogMenu

In place of a callable you can use the name of a function in my usermod, a Python module given by name. I’ll import it when I need it.

Needs to be instantiated with a LiSE engine – probably an EngineProxy.

advance_dialog(after_ok=None, *args)[source]

Try to display the next dialog described in my todo.

Parameters:

after_ok – An optional callable. Will be called after the user clicks

a dialog option–as well as after any game-specific code for that option has run.

ok(*args, cb=None, cb2=None)[source]

Clear dialog widgets, call ``cb``s if provided, and advance the dialog queue

class ELiDE.dialog.DialogMenu(**kwargs)[source]

Some buttons that make the game do things.

Set options to a list of pairs of (text, function) and the menu will be populated with buttons that say text that call function when pressed.

options

List of pairs of (button_text, callable)

class ELiDE.dialog.MessageBox(**kwargs)[source]

Looks like a TextInput but doesn’t accept any input.

Does support styled text with BBcode.

class ELiDE.dialog.ScrollableLabel(**kwargs)[source]

rulesview

Here you can assemble rules out of prewritten functions. First pick which rule to edit from the menu on the left, using the box at the bottom to add one if needed. Then go through the trigger, prereq, and action tabs, and drag the functions from the right pile to the left to include them in the rule. You may also reorder them within the left pile.

Rules made here will apply to the entity currently selected in the main screen. There is currently no graphical way to apply the same rulebook to many entities. You can, however, select nothing, in which case you get the option to edit rulebooks that apply to the current character overall.

class ELiDE.rulesview.CharacterRulesScreen(**kw)[source]

Screen with TabbedPanel for all the character-rulebooks

class ELiDE.rulesview.RuleButton(**kwargs)[source]

A button to select a rule to edit

on_state(*args)[source]

If I’m pressed, unpress all other buttons in the ruleslist

class ELiDE.rulesview.RulesBox(**kwargs)[source]

A BoxLayout containing a RulesList and a RulesView

As well as an input for a new rule name; a button to add a new rule by that name; and a close button.

Currently has no way to rename rules (2018-08-15)

class ELiDE.rulesview.RulesList(**kwargs)[source]

A list of rules you might want to edit

Presented as buttons, which you can click to select one rule at a time.

on_rulebook(*args)[source]

Make sure to update when the rulebook changes

redata(*args)[source]

Make my data represent what’s in my rulebook right now

class ELiDE.rulesview.RulesScreen(**kw)[source]

Screen containing a RulesBox for one rulebook

class ELiDE.rulesview.RulesView(**kwargs)[source]

The view to edit a rule

Presents three tabs, one each for trigger, prereq, and action. Each has a deckbuilder in it with a column of used functions and a column of unused actions.

finalize(*args)[source]

Add my tabs

get_functions_cards(what, allfuncs)[source]

Return a pair of lists of Card widgets for used and unused functions.

Parameters:
  • what – a string: ‘trigger’, ‘prereq’, or ‘action’

  • allfuncs – a sequence of functions’ (name, sourcecode, signature)

inspect_func(namesrc)[source]

Take a function’s (name, sourcecode) and return a triple of (name, sourcecode, signature)

on_rule(*args)[source]

Make sure to update when the rule changes

pull_actions(*args)[source]

Refresh the cards in the action builder

pull_prereqs(*args)[source]

Refresh the cards in the prereq builder

pull_triggers(*args)[source]

Refresh the cards in the trigger builder

set_functions(what, allfuncs)[source]

Set the cards in the what builder to allfuncs

Parameters:
  • what – a string, ‘trigger’, ‘prereq’, or ‘action’

  • allfuncs – a sequence of triples of (name, sourcecode, signature) as taken by my get_function_cards method.

spritebuilder

A screen to put together a graphic from premade parts for a Place or Thing.

class ELiDE.spritebuilder.PawnConfigDialog(**kwargs)[source]
class ELiDE.spritebuilder.PawnConfigScreen(**kw)[source]
class ELiDE.spritebuilder.SpotConfigDialog(**kwargs)[source]
class ELiDE.spritebuilder.SpotConfigScreen(**kw)[source]
class ELiDE.spritebuilder.SpriteBuilder(**kwargs)[source]
class ELiDE.spritebuilder.SpriteDialog(**kwargs)[source]
class ELiDE.spritebuilder.SpriteSelector(**kwargs)[source]

dummy

The pawn and spot that you can drag to place into the world.

class ELiDE.dummy.Dummy(**kwargs)[source]

A widget that looks like the ones on the graph, which, when dragged onto the graph, creates one of them.

on_paths(*args, **kwargs)[source]

Make textures from the images in paths, and assign them at the same index in my texs as in my paths.

on_touch_down(touch)[source]

If hit, record my starting position, that I may return to it in on_touch_up after creating a real graph.Spot or graph.Pawn instance.

on_touch_move(touch)[source]

Follow the touch

on_touch_up(touch)[source]

Return to pos_start, but first, save my current pos into pos_up, so that the layout knows where to put the real graph.Spot or graph.Pawn instance.

pallet

Individual menus of parts for the sprites.

Widget to display the contents of a kivy.atlas.Atlas in one kivy.uix.togglebutton.ToggleButton apiece, arranged in a kivy.uix.stacklayout.StackLayout. The user selects graphics from the Pallet, and the Pallet updates its selection list to show what the user selected.

class ELiDE.pallet.Pallet(**kwargs)[source]

Many SwatchButton, gathered from an kivy.atlas.Atlas.

atlas

kivy.atlas.Atlas object I’ll make SwatchButton from.

filename

Path to an atlas; will construct kivy.atlas.Atlas when set

selection

List of :class:`SwatchButton`s that are selected

selection_mode

Whether to allow only a ‘single’ selected SwatchButton (default), or ‘multiple’

swatch_height

Height of each and every SwatchButton here

swatch_size

Size of each and every SwatchButton here

swatch_width

Width of each and every SwatchButton here

swatches

SwatchButton widgets here, keyed by name of their graphic

upd_textures(*args)[source]

Create one SwatchButton for each texture

class ELiDE.pallet.PalletBox(**kwargs)[source]
class ELiDE.pallet.SwatchButton(**kwargs)[source]

Toggle button containing a texture and its name, which, when toggled, will report the fact to the Pallet it’s in.

tex

Texture to display here

statlist

A two-column table of an entity’s stats and their values. You can use this to build a primitive interface to your game, or just monitor the state of the world. By default, they are all shown as Readouts, which is to say, plain text.

By default, stats’ values are displayed as read-only text, but an entity with a dictionary stat named "_config" may display them other ways by setting a key with the same name as the stat to a dictionary value, with its key "control" set to one of:

  • "readout" for the default read-only text display.

  • "textinput" for editable text, to be parsed as a Python dictionary,

    list, tuple, or string. If the content cannot be parsed, it will be treated as a string. Surround the content with quotation marks if you want to be sure it is a string.

  • "slider" for picking a number within a range. Set the keys "min"

    and "max" to specify the range.

  • "togglebutton" for switching between True and False. To display

    a different string for each, set the keys "true_text" and "false_text".

Grid of current values for some entity. Can be changed by the user. Autoupdates when there’s a change for any reason.

class ELiDE.statlist.BaseStatListView(**kwargs)[source]

Base class for widgets showing lists of stats and their values

app

The Kivy app object

del_key(k)[source]

Delete the key and any configuration for it

engine

A LiSE.proxy.EngineProxy object

init_config(key)[source]

Set the configuration for the key to something that will always work

iter_data()[source]

Iterate over key-value pairs that are really meant to be displayed

munge(k, v)[source]

Turn a key and value into a dictionary describing a widget to show

proxy

A proxy object representing a LiSE entity

set_config(key, option, value)[source]

Set a configuration option for a key

set_configs(key, d)[source]

Set the whole configuration for a key

set_value(k, v)[source]

Set a value on the proxy, parsing it to a useful datatype if possible

upd_data(*args)[source]

Update to match new entity data

statcfg

Configurator to change stat display modes within ELiDE.

class ELiDE.statcfg.ConfigListItem(**kwargs)[source]
class ELiDE.statcfg.ConfigListItemCustomizer(**kwargs)[source]
class ELiDE.statcfg.ConfigListItemSlider(**kwargs)[source]
class ELiDE.statcfg.ConfigListItemToggleButton(**kwargs)[source]
class ELiDE.statcfg.ControlTypePicker(**kwargs)[source]
class ELiDE.statcfg.FloatInput(**kwargs)[source]
insert_text(s, from_undo=False)[source]

Insert new text at the current cursor position. Override this function in order to pre-process text for input validation.

class ELiDE.statcfg.StatListViewConfigurator(**kwargs)[source]
munge(k, v)[source]

Turn a key and value into a dictionary describing a widget to show

class ELiDE.statcfg.StatScreen(**kw)[source]
new_stat()[source]

Look at the key and value that the user has entered into the stat configurator, and set them on the currently selected entity.

stores

Editor widgets for strings and Python code.

Editors for textual data in the database.

The data is accessed via a “store” – a mapping onto the table, used like a dictionary. Each of the widgets defined here, StringsEditor and FuncsEditor, displays a list of buttons with which the user may select one of the keys in the store, and edit its value in a text box.

class ELiDE.stores.EdBox(**kwargs)[source]

Box containing most of an editor’s screen

Has a StoreList and an Editor, which in turn holds a name field and a big text entry box.

data

Dictionaries describing widgets in my storelist

disable_text_input

Set to True to prevent entering text in the editor

editor

An instance of a subclass of Editor

store

Proxy to the store I represent

store_name

Name of my store, so I can get it from the engine

storelist

An instance of StoreList

toggle

Function to show or hide my screen

class ELiDE.stores.Editor(**kwargs)[source]

Abstract widget for editing strings or functions

delete(*args)[source]

Remove the currently selected item from my store

disable_text_input

Whether to prevent text entry (not name entry)

name_wid

Text input widget holding the name of the string being edited

save(*args)[source]

Put text in my store, return True if it changed

store

Proxy to the FunctionStore or StringStore

class ELiDE.stores.FuncEditor(**kwargs)[source]

The editor widget for working with any particular function.

Contains a one-line field for the function’s name and a multi-line field for its code.

storelist

Instance of StoreList that shows all the functions you can edit

class ELiDE.stores.FuncsEdBox(**kwargs)[source]

Widget for editing the Python source of funcs to be used in LiSE sims.

Contains a list of functions in the store it’s about, next to a FuncEditor showing the source of the selected one, and a close button.

class ELiDE.stores.FuncsEdScreen(**kw)[source]

Screen containing three FuncsEdBox

Triggers, prereqs, and actions.

class ELiDE.stores.FunctionNameInput(**kwargs)[source]

Input for the name of a function

Filters out illegal characters.

insert_text(s, from_undo=False)[source]

Insert new text at the current cursor position. Override this function in order to pre-process text for input validation.

class ELiDE.stores.LanguageInput(**kwargs)[source]

Widget to enter the language you want to edit

screen

The instance of StringsEdScreen that I’m in

class ELiDE.stores.RecycleToggleButton(**kwargs)[source]

Toggle button at some index in a RecycleView

on_touch_down(touch)[source]

Receive a touch down event.

Parameters:
touch: MotionEvent class

Touch received. The touch is in parent coordinates. See relativelayout for a discussion on coordinate systems.

Returns:

bool If True, the dispatching of the touch event will stop. If False, the event will continue to be dispatched to the rest of the widget tree.

class ELiDE.stores.StoreButton(**kwargs)[source]

RecycleToggleButton to select something to edit in a Store

name

Name of this particular item

select

Function that gets called with my index when I’m selected

source

Text of this item

store

Either a FunctionStore or a StringStore

class ELiDE.stores.StoreList(**kwargs)[source]

Holder for a kivy.uix.listview.ListView that shows what’s in a store, using one of the StoreAdapter classes.

boxl

Instance of SelectableRecycleBoxLayout

redata(*args, **kwargs)[source]

Update my data to match what’s in my store

select_name(name, *args)[source]

Select an item by its name, highlighting

selection_name

The name of the StoreButton currently selected

store

Either a FunctionStore or a StringStore

class ELiDE.stores.StringInput(**kwargs)[source]

Editor for human-readable strings

validate_name_input

Boolean function for checking if a string name is acceptable

class ELiDE.stores.StringNameInput(**kwargs)[source]

Small text box for the names of strings

class ELiDE.stores.StringsEdBox(**kwargs)[source]

Box containing most of the strings editing screen

Contains the storelist and the editor, which in turn contains the string name input and a bigger input field for the string itself.

class ELiDE.stores.StringsEdScreen(**kw)[source]

A screen in which to edit strings to be presented to humans

Needs a toggle function to switch back to the main screen; a language identifier; and a language_setter function to be called with that language when changed.

edbox

Widget containing editors for the current string and its name

language

Code identifying the language we’re editing

toggle

Function to switch back to the main screen

ELiDE.stores.munge_source(v)[source]

Take Python source code, return a pair of its parameters and the rest of it dedented

Python Editor

Click the Python button to edit your game code in the IDE if you like. In this case, you can’t use any of the decorators. Choose the appropriate tab from Trigger, Prereq, or Action at the top, and the function you write will show up in the appropriate part of the rules editor.

Strings Editor

The LiSE engine has an attribute string that is accessed like a dictionary and used to store arbitrary strings, such as might be shown in a menu. You can edit those here. You can store strings for multiple languages, and switch between them programmatically by setting engine.string.language.

util

Miscellaneous helpful things

class ELiDE.util.SelectableRecycleBoxLayout(**kwargs)[source]
ELiDE.util.dummynum(character, name)[source]

Count how many nodes there already are in the character whose name starts the same.

ELiDE.util.fortyfive = 0.7853981633974483

pi / 4

ELiDE.util.get_thin_rect_vertices(ox, oy, dx, dy, r)[source]

Given the starting point, ending point, and width, return a list of vertex coordinates at the corners of the line segment (really a thin rectangle).

ELiDE.util.ninety = 1.5707963267948966

pi / 2

class ELiDE.util.trigger(func_or_timeout)[source]

Make a trigger from a method.

Decorate a method with this and it will become a trigger. Supply a numeric parameter to set a timeout.

Not suitable for methods that expect any arguments other than dt. However you should make your method accept *args for compatibility.

ELiDE.util.try_load(loader, obj)[source]

Return the JSON interpretation the object if possible, or just the object otherwise.

app

Entry point to ELiDE

Object to configure, start, and stop ELiDE.

class ELiDE.app.ELiDEApp(**kwargs)[source]

Extensible LiSE Development Environment.

build()[source]

Initializes the application; it will be called only once. If this method returns a widget (tree), it will be used as the root widget and added to the window.

Returns:

None or a root Widget instance if no self.root exists.

build_config(config)[source]

Set config defaults

delete_selection()[source]

Delete both the selected widget and whatever it represents.

init_board(*args)[source]

Get the board widgets initialized to display the game state

Must be called after start_subprocess

new_board(name)[source]

Make a graph for a character name, and switch to it.

on_pause()[source]

Sync the database with the current state of the game.

on_stop(*largs)[source]

Sync the database, wrap up the game, and halt.

select_character(char)[source]

Change my character to the selected character object if they aren’t the same.

set_tick(t)[source]

Set my tick to the given value, cast to an integer.

set_turn(t)[source]

Set the turn to the given value, cast to an integer

start_subprocess(*args)[source]

Start the LiSE core and get a proxy to it

Must be called before init_board

title = 'ELiDE'

Title of your application. You can set this as follows:

class MyApp(App):
    def build(self):
        self.title = 'Hello world'

Added in version 1.0.5.

Changed in version 1.8.0: title is now a StringProperty. Don’t set the title in the class as previously stated in the documentation.

Note

For Kivy < 1.8.0, you can set this as follows:

class MyApp(App):
    title = 'Custom title'

If you want to dynamically change the title, you can do:

from kivy.base import EventLoop
EventLoop.window.title = 'New title'
update_calendar(calendar, past_turns=1, future_turns=5)[source]

Fill in a calendar widget with actual simulation data