Docs / Making content / HTML textures: modern engine
Tips for beginners
- Start from
demo.htmland 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 prefixhtmltexture console:, which is the quickest way to see whatomsi.vehicleoromsi.depotreally 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.