UnrealEngineHTML5 / Documentation

533 stars 183 forks source link

[question] WebGL browser scripting #6

Closed PabsBraz closed 4 years ago

PabsBraz commented 4 years ago

Hi everyone!

I've got a question. After reading the documentation, I haven't found if there is a way to directly interact with the resulting WebGL code from the Browser without tweaking WebGL code itself.

Is this possible or all interaction with Actors must be programmed pre-packaging?

Thanks!

nickshinpho commented 4 years ago

this question is a little vague. but, if you're looking to interact from the browser (i.e. outside of "game code" and via javascript) to the "game code" (i.e. c++ engine code) -- yes, this is possible. and yes, this can only be done via programming pre-packaging (to make it easy for you access/traverse the UE4 objects).

taking a look at:

you can see the JS functions wrapped up in the UE_JavascriptLibrary object and this can be accessed via c++ that are exposed in theextern "C" headers.

those files (HTML5JavaScriptFx.{.h,.js}) shows how to:

hope this helps.

PabsBraz commented 4 years ago

It does indeed @nickshinpho. That's exactly what I was looking for. Thanks for the help and sorry for not being more specific in my first question.

Cheers!