I noticed that the button to change the BabylonJS version is not visible on mobile (tested on latest Android and iOS in their default browsers, Chrome and Safari respectively.)
To work around this, I made a JavaScript snippet you can drop into any playground that will allow you to swap your version. It works by manipulating the version dropdown which exists but is not visible.
Obviously, since it exists and simply isn’t visible, it would be fairly easy to update Playground so the version dropdown exists in the mobile interface. I don’t know who has control over the Playground codebase but I kindly ask that you do it if I am able to contribute via pull request I sure can try.
Here’s the snippet:
// silly hack to switch BabylonJS version on mobile.
setTimeout( () => {
if( window.innerWidth > 500 ) return;// rough targeting of mobile only
const versions_available = [
'Latest',
'4.1.0',
'4.0.3',
'3.3'
];
const desired_version = versions_available[1]; // change this to change the version it switches to!
var dropdowns = document.getElementsByClassName('command-dropdown');
console.log(dropdowns);
for( var i = 0; i < dropdowns.length; i++ ){
console.log('dropdown ' + i, dropdowns[i].attributes );
if( dropdowns[i].attributes.getNamedItem('title').value === 'Versions' ){
// alert('button exists')
dropdowns[i].click();
}
}
var current_version = document.getElementsByClassName('version-number')[0].innerHTML;
// alert('current version: ' + current_version);
var versions = document.getElementsByClassName('command-dropdown-label');
console.log(versions);
for( var i = 0; i < versions.length; i++ ){
console.log('version ' + i, versions[i].attributes );
if( versions[i].attributes.getNamedItem('title').value === desired_version ){
if( current_version !== desired_version ){
// alert('switching to ' + desired_version);
versions[i].click();
} else {
break;
}
}
}
},3000);
PS, I’m diving deep into BJS development for my job, so I expect to be around these forums on the regular. I’ve benefited from this forum already and look forward to contributing more. Cheers!
Nick Kramer
InnovatAR Inc.
https://yondar.me