Game Development Community

Display screenshot as background

by CodingChris · in Torque Game Engine · 08/17/2007 (6:35 am) · 2 replies

Hi,
I want to change every gui background image with an random image, but I don't know how to get a random image...
Hope for help.

#1
08/17/2007 (8:06 am)
Name your images numerically.

e.g.:
screenshot1.jpg
screenshot2.jpg
screenshot3.jpg

Then generate a random number using e.g.

%ss = getRandom(1,3);

then build your filename

%fn = "/starter.racing/client/ui/screenshot" @ %ss @ ".jpg";

and finally set your background image bitmap object to use %fn
#2
08/17/2007 (11:34 am)
There's a problem I want to use the screenshots in a directory... How would I read a folder?