I want to place images randomly based on the (x,y) co-ordinate values and that should compatible with all the devices having any screen resolution.
Give a clear description of co-ordinate system for any device screens.
Generate a random number between
0 to (screen width - image width)
for x
,
and a random number between
0 to (screen height - image height)
for y
.
And set them as the x and y coordinates of your image. I don't feel any more explanation is necessary.
BTW, the coordinate system for mobile device is as follows.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.