Python library for loading and writing Line Rider tracks
Project description
TRK-Loader-Python
Line Rider .trk format implemented in Python 3
Loading Tracks
from lrtools.trkformat import * # trk format
from lrtools.track import * # track and line objects
from lrtools.utils import * # utilities
To load a track name.trk
:
track = load_trk("track.trk", "name")
Saving Tracks
from lrtools.trkformat import * # trk format
from lrtools.track import * # track and line objects
from lrtools.utils import * # utilities
To save a track as name.trk
:
track = Track()
save_trk(track, "name.trk")
Track Structure
# assuming track is a Track object:
track.YGravity : int # Y gravity
track.XGravity : int # X gravity
track.GravityWellSize : int # Gravity well size
track.BGColorR : int
track.BGColorG : int
track.BGColorB : int
track.LineColorR : int
track.LineColorG : int
track.LineColorB : int
track.lines : List[Line]
track.Filename : str
track.Name : str
track.Remount : bool
track.ZeroStart : bool
track.frictionless : bool
track.ver : int (61 or 62)
track.StartOffset : Vector
track.Triggers : list
track.StartZoom : int
track.current_id : int
track.Triggers : list
Todo
- Add
prune()
method toTrack.Track
to prune line IDs - write the rest of the docs on other parts line line triggers and the
Line
object - Add JSON support
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lrtools-1.0.3.tar.gz
(8.4 kB
view details)
Built Distribution
File details
Details for the file lrtools-1.0.3.tar.gz
.
File metadata
- Download URL: lrtools-1.0.3.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9514f4ecd6765e1752273c2729925f3d31e5cb511c9e6b7967ebcf4fa2c4ff31 |
|
MD5 | 9083e12e46f8c397c1147f94c801f563 |
|
BLAKE2b-256 | 025aa650417c92aeac19cc4b49c013392eb4fd1ea2c3eb757e209da3aa7f608d |
File details
Details for the file lrtools-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: lrtools-1.0.3-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0a038f8e22cd4e858bfc6d02d961221941ef8f2e27c56756f1d8d07716f4534 |
|
MD5 | dc083bec44d04cd5481a2aa329ce4094 |
|
BLAKE2b-256 | 3ceb902b904b1c9cf5e9fbb877a05023aaca95fe4401f57728f8ce3e8d5b233d |