[ques] Loading css files into the game

There is a convenient GDT.loadJs([scripts], successCallback, errorCallback) function available but i can’t seem to find a loadCss function in the GDT object. Is there a way to load large number of CSS selectors apart from injecting them directly into the HTML (bad method IMO)

You can create the link and insert it dynamically.

    var importme = document.createElement('link');
        importme.id = 'myCss Sheet';
        importme.rel = 'stylesheet';
        importme.type = 'text/css';
        importme.href = 'mods/ModName/stylesheet.css';
document.getElementsByTagName('head')[0].appendChild(importme);
1 Like

Makes sense… thank you Sir!

1 Like