Forum

Interface CTRL

31 May 2015 07:29
I Want use your APP Realization toggle fullscreen an autorotate , like webapp,

1. Auto FullScreen
I found app.request_fullscreen can do this , then I try but failed
Excuse me for what reason?

html like this:

<body class="B4W-demo">

	<div id="canvas3d" ></div>
	<div id="ctrbar" >
		<button id="togglefullscreen" type="button">ToggleFullScreen</button>
		<button id="autorotate" type="button">AutoRotate</button>
	</div>
	<!-- Use B4W Function JS -->
	<script src="js/b4w.full.min.js"></script>
	<script src="js/ctrbar.js"></script>

</body>


js like this:

window.onload = function () {

    var isfullscreen = false;
    var canvas3d = getElementById('canvas3d');
    var togglefullscreen = getElementById('togglefullscreen');

	function gofullscreen() {
	    if (!isfullscreen) {
	        m_app.request_fullscreen(canvas3d,
	            function() {
	                isfullscreen = true;
	            },
	    } else {
	        isfullscreen = false;
	    }
	}

    togglefullscreen.addEventListener('click', gofullscreen, false);

}


2. Auto Rotate

Which Module Can do ? I don't find

Thank you my teacher answer my questions

01 June 2015 11:30
Hi.

1. Auto FullScreen
I found app.request_fullscreen can do this , then I try but failed
app.request_fullscreen could be called only after an engine loading.
You can read about it in our article and see linked file.

2. Auto Rotate
Which Module Can do ? I don't find
It is here.
Blend4Web Team
kirill@blend4web.com
 
Please register or log in to leave a reply.