How do I display Random Images for a loading screen?
Hello everyone who reads this. I'm simply trying to figure out how to display images during a loading screen, BUT I want them to appear RANDOMLY.
A Perfect Example is Mafia 3's Loading Screen. Sample here - > https://www.youtube.com/watch?v=4794KXEVCjw
Those pictures are generated randomly every time the loading screen appears. That is EXACTLY what I am trying to do.
No matinees, or cutscenes, or disabled player controllers so the video is displayed on a curved plane... Just images in a randomized slideshow for a loading screen...
P.s. I cant believe this isnt a more popular topic...I cant find info on this anywhere..
asked Oct 10 '18 at 07:10 AM in Using UE4
Sure, no problem. I made a very simple widget blueprint to demonstrate.
On the designer tab I basically dragged in an image from the palette to the canvas, named it "Loading Screen Image" set its anchors to fill the whole screen, and zeroed out the offsets. (You could improve this by adding a scale box to keep the image ratio).
Then in the event graph I created a array named "Background Images Array", set its type to hold texture 2d, and added 3 test images to it. Then on Event construct I get the loading screen image and set its brush texture (basically its background image) to a random image in the array. The random int in range node needs to know a minimum and maximum int, so to get the maximum I use the length of the array -1 (because the array starts at 0), this way the random int will always be valid and within the range of images in your array.
Whenever you create this widget a random image will be chosen and set, of course you could also create a custom event instead of using event construct and call that event whenever you want a random image.
I hope this helps! :)
assuming your using a empty level for your loading screen you just need to on begin play create loading screen widget. then as part of the widget have a image component. on construct do as others have said and set the image based on a random integer plugged into a get from an array. this solves your setting a background image issue. now to make it a slideshow you would do the same steps as before but you would also create a custom event that would be called each time you want to change the picture. connect the custom event at the same point as event construct then after setting the image add in a delay and then call the custom event. this will create a basic loop which changes the image each time its run.
answered Oct 12 '18 at 01:36 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here