<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to APP_BASE</title><link>https://sourceforge.net/p/pirobot/wiki/APP_BASE/</link><description>Recent changes to APP_BASE</description><atom:link href="https://sourceforge.net/p/pirobot/wiki/APP_BASE/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 20 Mar 2024 04:21:53 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pirobot/wiki/APP_BASE/feed" rel="self" type="application/rss+xml"/><item><title>APP_BASE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/APP_BASE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -10,6 +10,11 @@
 -------

 ##Global Variables
+###HOME_PATH
+The **FULL** path to the `MAIN.py` script and all other scripts provided here.
+Used for saving and loading stuff from and to the `userdata` and `appdata` directories.
+Needs a `/` at the end: `HOME_PATH="/mypath/"`
+
 ###underlyingApp
 The internal name of the App to be called when an (other) App gets closed.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Wed, 20 Mar 2024 04:21:53 -0000</pubDate><guid>https://sourceforge.net85456fc37bfc4b44095341abbd212b2e9a7a66e2</guid></item><item><title>APP_BASE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/APP_BASE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -1,5 +1,5 @@
+[TOC]
 #APP_BASE.py
-[TOC]
 Go back [Home]

 This is the main system file which has to be imported "everywhere": In the App files and in the [MAIN] file.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Fri, 08 Mar 2024 21:46:22 -0000</pubDate><guid>https://sourceforge.net47c02d2cf812990dfa8a53252e6e22236d5fd953</guid></item><item><title>APP_BASE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/APP_BASE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -1,4 +1,5 @@
 #APP_BASE.py
+[TOC]
 Go back [Home]

 This is the main system file which has to be imported "everywhere": In the App files and in the [MAIN] file.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Fri, 08 Mar 2024 21:46:06 -0000</pubDate><guid>https://sourceforge.netd9809378c92429e7cb9a2a109762b765abaab9ea</guid></item><item><title>APP_BASE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/APP_BASE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -1,4 +1,6 @@
 #APP_BASE.py
+Go back [Home]
+
 This is the main system file which has to be imported "everywhere": In the App files and in the [MAIN] file.
 It provides the basic functionalities of this system and the base application class where all Apps are derived from.

@@ -73,3 +75,8 @@

 ###def updateDeltaTime()
 Called in `APP_BASE.update` after each frame. Counts the time passed since the last frame in seconds and sets it to `APP_BASE.deltaTime`.
+
+---------
+Do you want to create your very own menu App? Because that is the next section: [APP_MENU]
+
+
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Fri, 08 Mar 2024 21:12:27 -0000</pubDate><guid>https://sourceforge.neteb0d606dcc2b201d3341eb0e2ab8c33057a59187</guid></item><item><title>APP_BASE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/APP_BASE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -19,7 +19,7 @@
 `appname` is the (internal) name to be referenced to. Usually the file name without ".py"
 `appinstance` is an instance to your App. Usually `myAppFile.App()` where `myAppFile` is the name of the file where your App resides.

-If you want to RESTART an App, completely just use `registerApplication` again with a *new* instance of your App.
+If you want to RESTART an App completely, just use `registerApplication` again with a *new* instance of your App.

 ###def setCurrentApp(appname)
 Switches to the App with  the given `appname` or to a *new*  `BaseAppClass`-instance if not found. It then shows the *empty application* screen.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Fri, 08 Mar 2024 21:08:33 -0000</pubDate><guid>https://sourceforge.netbe43bc43f463331b2d9ebde48129dd6729bc15ac</guid></item><item><title>APP_BASE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/APP_BASE/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -8,7 +8,7 @@

 ##Global Variables
 ###underlyingApp
-The application name of the App to be called when an (other) App gets closed.
+The internal name of the App to be called when an (other) App gets closed.

 --------

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Fri, 08 Mar 2024 21:07:36 -0000</pubDate><guid>https://sourceforge.netc5782a37b06e6a02a02cb11c46fa8ea45766eb0f</guid></item><item><title>APP_BASE modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/APP_BASE/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="app_basepy"&gt;APP_BASE.py&lt;/h1&gt;
&lt;p&gt;This is the main system file which has to be imported "everywhere": In the App files and in the &lt;a class="alink" href="/p/pirobot/wiki/MAIN/"&gt;[MAIN]&lt;/a&gt; file.&lt;br/&gt;
It provides the basic functionalities of this system and the base application class where all Apps are derived from.&lt;/p&gt;
&lt;p&gt;Internal used variables and functions are described at the end of this page.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id="global-variables"&gt;Global Variables&lt;/h2&gt;
&lt;h3 id="underlyingapp"&gt;underlyingApp&lt;/h3&gt;
&lt;p&gt;The application name of the App to be called when an (other) App gets closed.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id="functions"&gt;Functions&lt;/h2&gt;
&lt;h3 id="def-registerapplicationappname-appinstance"&gt;def registerApplication(appname, appinstance)&lt;/h3&gt;
&lt;p&gt;Use that function to register an instance of an App into the system.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;appname&lt;/code&gt; is the (internal) name to be referenced to. Usually the file name without ".py"&lt;br/&gt;
&lt;code&gt;appinstance&lt;/code&gt; is an instance to your App. Usually &lt;code&gt;myAppFile.App()&lt;/code&gt; where &lt;code&gt;myAppFile&lt;/code&gt; is the name of the file where your App resides.&lt;/p&gt;
&lt;p&gt;If you want to RESTART an App, completely just use &lt;code&gt;registerApplication&lt;/code&gt; again with a &lt;em&gt;new&lt;/em&gt; instance of your App.&lt;/p&gt;
&lt;h3 id="def-setcurrentappappname"&gt;def setCurrentApp(appname)&lt;/h3&gt;
&lt;p&gt;Switches to the App with  the given &lt;code&gt;appname&lt;/code&gt; or to a &lt;em&gt;new&lt;/em&gt;  &lt;code&gt;BaseAppClass&lt;/code&gt;-instance if not found. It then shows the &lt;em&gt;empty application&lt;/em&gt; screen.&lt;/p&gt;
&lt;h3 id="def-setcurrentapplication-setapplication-setapp-appname"&gt;def setCurrentApplication / setApplication / setApp (appname)&lt;/h3&gt;
&lt;p&gt;Other names to call &lt;code&gt;SetCurrentApp&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="def-initialize"&gt;def initialize()&lt;/h3&gt;
&lt;p&gt;Initialize the system. Needs to be called in &lt;a class="alink" href="/p/pirobot/wiki/MAIN/"&gt;[MAIN]&lt;/a&gt; just before the main loop.&lt;/p&gt;
&lt;h3 id="def-update"&gt;def update()&lt;/h3&gt;
&lt;p&gt;Updates the whole system (and the actual running App).&lt;br/&gt;
Call this inside the main loop. (See at the end of &lt;a class="alink" href="/p/pirobot/wiki/MAIN/"&gt;[MAIN]&lt;/a&gt;)&lt;br/&gt;
Returns &lt;code&gt;True&lt;/code&gt; when running and &lt;code&gt;False&lt;/code&gt; when exiting the program.&lt;/p&gt;
&lt;h3 id="def-quit"&gt;def quit()&lt;/h3&gt;
&lt;p&gt;Ends the program.&lt;br/&gt;
Call this at the very end of &lt;a class="alink" href="/p/pirobot/wiki/MAIN/"&gt;[MAIN]&lt;/a&gt;.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id="classes"&gt;Classes&lt;/h2&gt;
&lt;h3 id="baseappclass"&gt;BaseAppClass&lt;/h3&gt;
&lt;p&gt;The basic App class which provides the functions used by this system.&lt;br/&gt;
Derive your App-class from that class.&lt;br/&gt;
You may overwrite all of the functions except for the &lt;code&gt;__initialize__&lt;/code&gt; (with lower case - ) function.&lt;br/&gt;
See &lt;a class="alink" href="/p/pirobot/wiki/APP_TEMPLATE/"&gt;[APP_TEMPLATE]&lt;/a&gt; for further information.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id="internal-used-stuff"&gt;INTERNAL USED STUFF&lt;/h2&gt;
&lt;p&gt;This is just here for reference. &lt;strong&gt;DO NOT USE&lt;/strong&gt;, itŝ already used by the system itself.&lt;/p&gt;
&lt;h3 id="screensurface"&gt;screensurface&lt;/h3&gt;
&lt;p&gt;The &lt;em&gt;pygame display surface&lt;/em&gt; used for drawing directly to the screen.&lt;br/&gt;
Passed to the &lt;code&gt;update&lt;/code&gt; function of an App.&lt;/p&gt;
&lt;h3 id="applicationlist"&gt;applicationList&lt;/h3&gt;
&lt;p&gt;The &lt;em&gt;array&lt;/em&gt; containing the Application instances with their internal names.&lt;/p&gt;
&lt;h3 id="current_app"&gt;CURRENT_APP&lt;/h3&gt;
&lt;p&gt;The current running App(-instance).&lt;/p&gt;
&lt;h3 id="deltatime"&gt;deltaTime&lt;/h3&gt;
&lt;p&gt;The time passed since the last frame in seconds&lt;br/&gt;
This variable is passed to the current running Apps &lt;code&gt;update&lt;/code&gt; function, so you don't have to use it directly.&lt;/p&gt;
&lt;h3 id="deltaoldtime"&gt;deltaOldTime&lt;/h3&gt;
&lt;p&gt;The &lt;em&gt;time stamp&lt;/em&gt; of the frame previous to the last one.&lt;br/&gt;
Used to calculate &lt;code&gt;deltaTime&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="def-updatedeltatime"&gt;def updateDeltaTime()&lt;/h3&gt;
&lt;p&gt;Called in &lt;code&gt;APP_BASE.update&lt;/code&gt; after each frame. Counts the time passed since the last frame in seconds and sets it to &lt;code&gt;APP_BASE.deltaTime&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Fri, 08 Mar 2024 21:07:07 -0000</pubDate><guid>https://sourceforge.net94e7fdc5d6ccddb5a1b2fbeaa6d1f69d0e7001f4</guid></item></channel></rss>