Fullscreen, real size issue?

Hello, I added 2 buttons to make full screen and real size in my project. When I press the full screen button, the screen gets bigger, but when I press the “esc” key, the screen shrinks without changing the icon. How can I get the “esc” key to be checked?

1 Like

Hi Emrah,

You can handle the fullscreenchange event in the project On Load event to update the icon:

AP.fullscreen.addEventListener('fullscreenchange', function() {
    if (AP.fullscreen.fullscreenElement()) {
        // fullscreen mode
    } else {
        // normal mode
    }
});

Regards

1 Like

Thanks it worked. But it works once because it is added to the onload part. How can I make this permanent? (It worked with the first click, then it didn’t work when I clicked again. The screen gets smaller, but the button icon does not change) @ToanLS

1 Like

The fullscreenchange will occur everytime the fullscreen mode is changed, so it should always work, not just once.
You can send your sample project to support@atomisystems.com for checking if you can’t manage to make it work.

Regards

I sent an e-mail, did it arrive? @ToanLS

Hi Emrah,

Thank you for sending the project via email. We will check it and respond to you promptly.

Best regards,

1 Like

Thank you, I look forward to hearing from you.

Hi Emrah,

Your project use the tamekran variable to update the fullscreen icon when changing slides, so you’ll need to update this variable in the fullscreenchange too.

AP.fullscreen.addEventListener('fullscreenchange', function() {
    if (AP.fullscreen.fullscreenElement()) {
        // fullscreen mode
		prez.object('tamekran').hide();
		prez.object('tamekrançık').show();
		prez.variable('tamekran', true);
    } else {
        // normal mode
		prez.object('tamekran').show();
		prez.object('tamekrançık').hide();
		prez.variable('tamekran', false);
    }
});

You can also make tamekran and tamekrançık show over multiple slides so that you don’t need to update them on each slide.

Regards

1 Like

Thank you very much, I needed this too. @ToanLS

Thank you it worked for me a lot. @ToanLS