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.
- wait_command(start_func, turns=1, end_func=None)[source]¶
Call
start_func
, and wait to callend_func
after simulatingturns
(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
- class ELiDE.game.GameScreen(**kw)[source]¶
- disable_input(cb=None)[source]¶
Set
self.disabled
toTrue
, then callcb
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 setself.disabled
toFalse
- Parameters:
cb – callback function for before enabling
- Returns:
None
- switch_screen¶
Method to set the
screen
attribute of the mainkivy.uix.screenmanager.ScreenManager
- wait_command(start_func, turns=1, end_func=None)[source]¶
Call
start_func
, waitturns
, and then callend_func
if providedDisables 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
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.GraphBoard(**kw)[source]¶
A graphical view onto a
LiSE.Character
, resembling a game graph.- make_pawn(thing)[source]¶
Make a
Pawn
to represent aThing
, store it, and return a dict suitable for StackPlane.add_datum
- make_spot(place)[source]¶
Make a
Spot
to represent aPlace
, store it, and return a dict suitable for StackPlane.add_datum
- class ELiDE.graph.board.GraphBoardScatterPlane(**kwargs)[source]¶
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 somePlace
or other. Accordingly,Pawn
’s coordinates are never set directly; they are instead derived from the location of theThing
represented. That means aPawn
will appear next to theSpot
representing thePlace
that itsThing
is in. The exception is if theThing
is currently moving from its currentPlace
to another one, in which case thePawn
will appear some distance along theArrow
that represents thePortal
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 theCharacter
that the underlyingPlace
is in. Its coordinates are relative to itsBoard
, not necessarily the window theBoard
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.
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.
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.
- touch:
- 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.
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.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 anObjectProperty
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
orgraph.Spot
.
- on_play_speed(*args)[source]¶
Change the interval at which
self.play
is called to match my currentplay_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.
- touch:
- 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.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.
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
orheadline_color
art_source
, the path to an image to be displayed below the headline; may be hidden by settingshow_art
toFalse
midline_text
, similar toheadline_text
but appearing below the arttext
, shown in a box the same size as the art. Styleable likeheadline_text
and you can customize the box with eg.foreground_color
andforeground_source
footer_text
, likeheadline_text
but at the bottom
Card
is particularly useful when put in aDeckLayout
, allowing the user to drag cards in between any number of piles, into particular positions within a particular pile, and so forth.- on_art_source(*args)[source]¶
When I get a new
art_source
, load it as anImage
and store that inart_image
.
- on_background_image(*args)[source]¶
When I get a new
background_image
, store its texture inbackground_texture
.
- on_background_source(*args)[source]¶
When I get a new
background_source
, load it as anImage
and store that inbackground_image
.
- on_foreground_image(*args)[source]¶
When I get a new
foreground_image
, store its texture in myforeground_texture
.
- on_foreground_source(*args)[source]¶
When I get a new
foreground_source
, load it as anImage
and store that inforeground_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.
- 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 withindecks
, 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 useadd_widget
.
- direction¶
Should the beginning card of each deck appear on the bottom (‘ascending’), or the top (‘descending’)?
- 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_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 aftercard
, 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 ofcard
.
- point_before_card(card, x, y)[source]¶
Return whether
(x, y)
is somewhere beforecard
, 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.
- 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 aDeckBuilderLayout
.- 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
.
- deckbuilder¶
The
DeckBuilderLayout
of the deck to scroll.
- deckidx¶
The index of the deck to scroll, within its
DeckBuilderLayout
’sdecks
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.
- 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 myscroll
to update my deckbuilder.
- orientation¶
Which way to scroll? Options are ‘horizontal’ and ‘vertical’.
- scroll¶
A number between 0 and 1 representing how far beyond
scroll_min
towardscroll_max
I am presently scrolled.
- scroll_hint¶
The distance between
scroll_max
andscroll_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?
- vbar¶
A tuple of
(y, height)
for my scroll bar, if it’s vertical.
- class ELiDE.card.DeckBuilderView(**kwargs)[source]¶
Just a
DeckBuilderLayout
mixed withStencilView
.
- 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
- class ELiDE.card.ScrollBarBar(**kwargs)[source]¶
Tiny tweak to
ColorTextureBox
to make it work withinDeckBuilderScrollBar
- 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 providedposhints
– they can be computed using the available keys together withsize_hint_x
andsize_hint_y
.
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()
ordeselect_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
, itsapply_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.
dialog¶
Simple data-driven UI interactions
Generic dialog boxes and menus, for in front of a Board
- class ELiDE.dialog.Dialog(**kwargs)[source]¶
MessageBox with a DialogMenu beneath it.
Set the properties
message_kwargs
andmenu_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
andDialogMenu
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 anEngineProxy
.
- 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 saytext
that callfunction
when pressed.- options¶
List of pairs of (button_text, callable)
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.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.
- 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.
- 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)
spritebuilder¶
A screen to put together a graphic from premade parts for a Place or Thing.
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 mytexs
as in mypaths
.
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 ankivy.atlas.Atlas
.- atlas¶
kivy.atlas.Atlas
object I’ll makeSwatchButton
from.
- filename¶
Path to an atlas; will construct
kivy.atlas.Atlas
when set
- 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
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 betweenTrue
andFalse
. To displaya 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
- engine¶
A
LiSE.proxy.EngineProxy
object
- proxy¶
A proxy object representing a LiSE entity
statcfg¶
Configurator to change stat display modes within ELiDE.
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
- disable_text_input¶
Whether to prevent text entry (not name entry)
- name_wid¶
Text input widget holding the name of the string being edited
- store¶
Proxy to the
FunctionStore
orStringStore
- 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.
- 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.
- touch:
- 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
- selection_name¶
The
name
of theStoreButton
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.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; alanguage
identifier; and alanguage_setter
function to be called with thatlanguage
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
- 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.
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.
- init_board(*args)[source]¶
Get the board widgets initialized to display the game state
Must be called after start_subprocess
- select_character(char)[source]¶
Change my
character
to the selected character object if they aren’t the same.
- 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'