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.
For an example of how to build a game with these, see the Awareness sim.
- 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
Widgetinstance if no self.root exists.
- next_turn(*_)[source]¶
Smoothly advance to the next turn in the simulation
This uses a subthread to wait for lisien 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_funcafter 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
cbif 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
turnsafter start_func
- Returns:
None
- class elide.game.GameScreen(**kw)[source]¶
- disable_input(cb=None)[source]¶
Set
self.disabledtoTrue, then callcbif provided- Parameters:
cb – callback function for after disabling
- Returns:
None
- disabled¶
If you bind your widgets’
disabledto this, they will be disabled when a game command is in mid-execution
- enable_input(cb=None)[source]¶
Call
cbif provided, then setself.disabledtoFalse- Parameters:
cb – callback function for before enabling
- Returns:
None
- switch_screen¶
Method to set the
screenattribute of the mainkivy.uix.screenmanager.ScreenManager
- wait_command(start_func, turns=1, end_func=None)[source]¶
Call
start_func, waitturns, and then callend_funcif 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
turnsafter 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
lisien.Character, resembling a game graph.- make_pawn(thing)[source]¶
Make a
Pawnto represent aThing, store it, and return a dict suitable for StackPlane.add_datum
- make_spot(place)[source]¶
Make a
Spotto represent aPlace, store it, and return a dict suitable for StackPlane.add_datum
- trigger_update(*args)¶
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 lisien core for a long time. Avoid when possible.
- 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.Thingis the lisien class to represent items that are located in somePlaceor other. Accordingly,Pawn’s coordinates are never set directly; they are instead derived from the location of theThingrepresented. That means aPawnwill appear next to theSpotrepresenting thePlacethat itsThingis in. The exception is if theThingis currently moving from its currentPlaceto another one, in which case thePawnwill appear some distance along theArrowthat represents thePortalit’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
Spotis located on the Board that represents theCharacterthat the underlyingPlaceis in. Its coordinates are relative to itsBoard, not necessarily the window theBoardis 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.
- 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.
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:
MotionEventclass Touch received. The touch is in parent coordinates. See
relativelayoutfor 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.Dialog(**kwargs)[source]¶
MessageBox with a DialogMenu beneath it.
Set the properties
message_kwargsandmenu_kwargs, respectively, to control them – but you probably want to do that by returning a pair of dicts from an action in lisien.
- class elide.screen.DialogLayout(**kwargs)[source]¶
A layout, normally empty, that can generate dialogs
To make dialogs, set my
todoproperty 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
MessageBoxandDialogMenu
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 lisien
engine– probably anEngineProxy.
- class elide.screen.DialogMenu(**kwargs)[source]¶
Some buttons that make the game do things.
Set
optionsto a list of pairs of(text, function)and the menu will be populated with buttons that saytextthat callfunctionwhen pressed.- options¶
List of pairs of (button_text, callable)
- 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.
- name = 'mainscreen'¶
Name of the screen which must be unique within a
ScreenManager. This is the name used forScreenManager.current.nameis aStringPropertyand defaults to ‘’.
- next_turn(cb=None, *_)[source]¶
Advance time by one turn, if it’s not blocked.
Block time by setting
engine.universal['block'] = True
- on_dummies(*_)[source]¶
Give the dummies numbers such that, when appended to their names, they give a unique name for the resulting new
graph.Pawnorgraph.Spot.
- on_play_speed(*_)[source]¶
Change the interval at which
self.playis called to match my currentplay_speed.
- on_touch_down(touch)[source]¶
Receive a touch down event.
- Parameters:
- touch:
MotionEventclass Touch received. The touch is in parent coordinates. See
relativelayoutfor 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.MessageBox(**kwargs)[source]¶
Looks like a TextInput but doesn’t accept any input.
Does support styled text with BBcode.
- 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 starts and stop the game, or sets the time.
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 lisien 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_nameorheadline_colorart_source, the path to an image to be displayed below the headline; may be hidden by settingshow_arttoFalsemidline_text, similar toheadline_textbut appearing below the arttext, shown in a box the same size as the art. Styleable likeheadline_textand you can customize the box with eg.foreground_colorandforeground_sourcefooter_text, likeheadline_textbut at the bottom
Cardis 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 anImageand 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 anImageand 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 anImageand 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
Cardobjects 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
Cardobjects 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_offsetsproperties 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.
- remove_widget(widget, *args, **kwargs)[source]¶
Remove a widget from the children of this widget.
- Parameters:
- widget:
Widget Widget to remove from our children list.
- widget:
>>> from kivy.uix.button import Button >>> root = Widget() >>> button = Button() >>> root.add_widget(button) >>> root.remove_widget(button)
- 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
DeckBuilderLayoutof the deck to scroll.
- deckidx¶
The index of the deck to scroll, within its
DeckBuilderLayout’sdecksproperty.
- 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 myscrollto 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_mintowardscroll_maxI am presently scrolled.
- scroll_hint¶
The distance between
scroll_maxandscroll_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
DeckBuilderLayoutmixed 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
ColorTextureBoxto 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_xandsize_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.
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 mytexsas 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.Atlasobject I’ll makeSwatchButtonfrom.
- filename¶
Path to an atlas; will construct
kivy.atlas.Atlaswhen set
- selection_mode¶
Whether to allow only a ‘single’ selected
SwatchButton(default), or ‘multiple’
- swatch_height¶
Height of each and every
SwatchButtonhere
- swatch_size¶
Size of each and every
SwatchButtonhere
- swatch_width¶
Width of each and every
SwatchButtonhere
- swatches¶
SwatchButtonwidgets here, keyed by name of their graphic
- upd_textures(*_)[source]¶
Create one
SwatchButtonfor 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 betweenTrueandFalse. 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
lisien.proxy.EngineProxyobject
- proxy¶
A proxy object representing a lisien 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
Trueto 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
- deletable¶
Whether to show a delete button
- 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
FunctionStoreorStringStore
- 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
StoreListthat 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 lisien 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
StringsEdScreenthat 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:
MotionEventclass Touch received. The touch is in parent coordinates. See
relativelayoutfor 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
indexwhen 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.ListViewthat shows what’s in a store, using one of the StoreAdapter classes.- boxl¶
Instance of
SelectableRecycleBoxLayout
- selection_name¶
The
nameof theStoreButtoncurrently 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
togglefunction to switch back to the main screen; alanguageidentifier; and alanguage_setterfunction to be called with thatlanguagewhen 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¶
lisien.Engine objects have 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
app¶
Entry point to Elide
Object to configure, start, and stop elide.
- class elide.app.ElideApp(**kwargs)[source]¶
Extensible lisien 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
Widgetinstance if no self.root exists.
- init_board(*_)[source]¶
Get the board widgets initialized to display the game state
Must be called after start_subprocess
- on_resume()[source]¶
Event handler called when your application is resuming from the Pause mode.
Added in version 1.1.0.
Warning
When resuming, the OpenGL Context might have been damaged / freed. This is where you can reconstruct some of your OpenGL state e.g. FBO content.
- select_character(char: CharacterProxy)[source]¶
Change my
characterto the selected character object if they aren’t the same.
- start_subprocess(path=None, archive_path=None, *_)[source]¶
Start the lisien 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'
- trigger_start_subprocess(path=None, archive_path=None, *_)¶
Start the lisien core and get a proxy to it
Must be called before
init_board