Jgc
Posts: 0
Joined: Wed Mar 07, 2012 8:58 pm

multi-image background

A way to have a random background image appear at the start of the app would be nice.

So the user starts the app, imageA is set for the background....A few hours later the app is run again by the user and imageB is set for the background. And so on. I imagine, it would make best sense if the background be selected from an multi-image selection dialogue box/window.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

multi-image background

You can do it today. Have a number of background images and randomly pick one (or any other method) when the app loads.

https://getsatisfaction.com/tiggzi/to...

Mike6580064
Posts: 0
Joined: Wed Jan 15, 2014 6:00 pm

multi-image background

Max,

Can you please provide these details again as the link above no longer works. I have an image component and would like its contents to be randomized from a handful of images. Is this possible?

Thanks,
Mike

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

multi-image background

Hi Mike,

Here is the thread https://getsatisfaction.com/apperyio/...

Mike6580064
Posts: 0
Joined: Wed Jan 15, 2014 6:00 pm

multi-image background

Alena,

I don't see anything there about randomized images.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

multi-image background

Hi Mike,

To get random image - you need to get random number before.

Here is a code to get random number:

pre

var randomMin = 100;
var randomMax = 300;

var random = Math.random() * (randomMax - randomMin);

var limitedRandom = Math.round(random + randomMin);

console.log("limitedRandom = " + limitedRandom);

/pre

Then when you get random image with certain limits - you can convert it into random text(from array).

So code to get random text from array is:

pre

var textArray = [
"firstText",
"secondText",
"thirdText",
"forthText",
"fivesText"
];

var randomMin = 0;
var randomMax = textArray.length;

var random = Math.random() * (randomMax - randomMin);

var limitedRandom = Math.round(random + randomMin);

var randomText = textArray[limitedRandom];

console.log("randomText = " + randomText);

/pre

Now you can put into textArray needed urls and you will get random url.

Regards.

Return to “Issues”