Skip to main content

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 to Track.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.2.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

lrtools-1.0.2-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page