Splash screen fading in

I was delighted that it’s possible to animate the backlight very smoothly. This can be used to fade in a splash screen when the device first turns on. The result is quite slick.

  1. Make the first page your splash screen. I recommend a full screen image with a corrected aspect ratio but whatever you want.
  2. In preinitialize:
    dim=0
    
  3. In postinitialize:
    for(dim=0;dim<100;dim++) {
      delay=30
    }
    delay=1000
    dp=1
    
2 Likes

Oh this is cool as heck. Nice idea @iref!

@Flatpack2 If you use the preformatted text formatting on code you won’t have the font issue. :slight_smile:

hi, thanks for the snippet. Just learning to use Nextion. Can I know what dp=1 in postinitialize is for?

Ok, I think I understand. dp=1 is to navigate to page with the id=1. I should have read the instruction set :blush:. Thanks.

Hello! Just started playing with the Nextion program. I liked this post and tried it straight away. I have an issue though. I want to be able to get a touch press event during the preinitializing face but it doesn’t seem to work. I have a picture on the same page as I have the postinitialize code. I’ve ticked in touch event for the picture but I’m not getting any response when touching the screen during preinitialize code. It works as expected on a normal page without that preinit code. What do you have to do to be able to have some kind of touch event at the same time as postinitialize code?

Thanks!