Hello ,
How can I lock screen orientation to landscape mode when game starts.
Below code I used but it seems not working fine.
var MobileView = pc.createScript('mobileView');
MobileView.prototype.initialize = function () {
if (pc.platform.mobile) {
console.log("Mobile device");
if (screen.orientation.lock('landscape-primary')) {
console.log("Orientation locked to landscape");
} else {
console.log("Orientation lock failed.");
}
}
};
thank you