openOMSI GitHub Discord

Docs / Making content / HTML textures: modern engine

Tips for beginners

1 min readEdit this pagedocs/HTMLTEXTURE_MODERN.md

  • Start from demo.html and change one thing at a time. If the texture goes blank, the last thing you touched is the culprit.
  • Write to the log. console.log(...) ends up in the game's log with the prefix htmltexture console:, which is the quickest way to see what omsi.vehicle or omsi.depot really contain on your bus.
  • Guard for missing data. A bus without a depot file has no omsi.depot.routes, a bus without a timetable has no stops. Check the length before you loop.
  • Test on the real bus. Each bus fills the variable list differently, and some values you expect will simply be null.
  • Keep buttons big. The texture is often small on screen and people press it with a finger or a mouse. 60 px high is a good minimum.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open