Python SDK Modules¶
We’ve attempted to fully document the API here, noting changes from the official C-Language SDK. (Don’t forget to use the Search field in the header of each of these documentation web pages to find what you’re looking for!)
Most of the APIs in this documentation include example source code which can be cut and pasted into the Mini Python Interpreter.
Additionally:
Change Log. Lists recent changes to this SDK.
X-Plane Developer Documentation @ developer.x-plane.com. The official X-Plane SDK documentation is for C-language, and most of that has been translated to python and documented with XPPython3. However, when in doubt, check the Laminar docs.
Note we use a Simplified Python Interface as described in xp. This makes all interfaces available from:
import xp
You’ll find it much faster and easier to write new code using this interface and it won’t wear out your X-P-L-M keys. You can use the older style, but you’ll have to import each module separately:
import XPLMMenus
For compatibility with Laminar documentation, this documentation splits the SDK along the same divisions:
Control camera angle. |
|
Read/Write DataRefs, also create your own. |
|
Enumerations for Keycodes, primarily. |
|
|
|
|
|
Preferred drawing routines using “objects” loaded by XPLMScenery. Create, destroy and set position of instances. |
|
Create new layer and draw on X-Plane map. |
|
Create menus & menu items and provide handlers. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Play sound, at a specific location, in a particular direction, with fading. (Uses FMOD). |
|
|
X-Planes’s Widget modules:
Create, destroy and otherwise manipuated pre-defined (“standard”) widgets. Send (widget) messages, and handle messages through callbacks. |
|
Pre-defined widgets, with their properties and messages. Including
|
|
Enumerations related to widgets – mostly message and property IDs. |
|
Mostly useless functions. |
And three XPPython-specific additions (also accessible with simple import xp
.)
The only python modules you really need. This page also describes the pythonic, simplified API mapping with optional and keyword parameters. |
|
API to the Dear ImGui graphics library, with examples. |
|
|