Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello, for that you need to run hintLocals, like so

for (let el of document.querySelectorAll("code:not(.gml)")) {
    el.classList.add("gml");
    var tks = [];
    gml_string.parse(el.innerHTML, tks);
    gml_string.hintLocals(tks);
    el.innerHTML = gml_string.renderToHTML(tks, "gml");
}

This is exactly the code I have.

Local var are not highlighted, only the class "gmlIdent" is added.

You can see it live here: https://indieklem.com/randomize-value-in-array-with-game-maker/ 

JS is here: https://indieklem.com/wp-content/themes/indieklem/js/gml_highlight.js

(+1)

Ah sorry, mixed up local and instance variables - it’s a bit of a busy week.

My website uses a slightly different highlighter but basically it’s just gmlIdent being styled to look blue when using the dark theme.

No worry :)
I will style the gmlIdent then, thanks for the advice :)