Hi, how can i pass a value from JavaScript to lua please ? I tried much thing like use streams but i don't unsterstand how to send my value in a stream Thanks
In your Lua: To create the html texture: Code: htmlTexture.create("textureName", "local://local/vehicles/fileName.html", textureWidthPixles, textureHeightPixels, updateSpeedInFPS, 'automatic') Make sure to leave the automatic parameter alone. The update speed may or may not be broken, I think it is stuck at 30fps currently. Then you can call the JavaScript like this: Code: htmlTexture.call("textureName", "functionName", parameter) If you want to pass multiple things then you need to pass "{value1 == value1, value2 == value2}" and so on.
No i don't want to do html texture, i want to modify the text of the button. But it doesn't seem to be possible from lua, so i made it from javascript, but i need a value that it in the lua :/ document.getElementById("THE BUTTON ID").textContent="HERE I WANT TO HAVE A LUA VALUE"; But this line is runned in Javascript
Ah, ok, my bad, I thought you were on about vehicle Lua/Javascript. With vehicles there is no way to return a value from the JavaScript to the Lua. But this may be different with Apps, I have no idea. Hopefully someone else can jump in and give you a proper solution
up --- Post updated --- This work: bngApi.engineLua( be:executeJS(\'document.getElementById("YOURBUTTONID").textContent= " \'.. YOUR VLUA VALUE .. \'" \') )