Access to app.js callback functions

02 December 2015 18:17

for my application, I modified the mouse_cb function from the app.js module to incorporate the option to toggle between camera panning and camera rotation.

Also, I invoked the mouse_wheel_cb function from another javascript file in order to perform zooming operations through a click handler in order to implement plus/minus button elements for an easier usage of the zoom functionality through buttons.

The problem is that both of these functions are "private", e.g. not accessible from another script. I worked around this by modifying the app.js file, which I now have to do with any subsequent B4W release.

Is it possible for you to export those functions in a later B4W release so it's easier to maintain my functionality?

I'd also be happy to hear that my approach here is unnecessarily complex - maybe there's a better way to do it?

Thanks in advance.
03 December 2015 12:45

Yes, this is a really acute problem and we have plans on making it easier to maintain changes made by users. The functions you described are a bit specific, so I'm not sure we'll put them into the original addon.
The best solution for now is to have your own some_addon.js which will implement required functionality. Thus, you won't need any updates when upgrading to a new b4w version.
Please register or log in to leave a reply.