Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Bestappleid

macrumors newbie
Original poster
Nov 7, 2015
1
0
Hey guys,
Using x-code and UIKit, I want to repeat 2 images for background of my app.

I used a cadisplaylink timer to move them, and it is working, after the image1 goes offscreen, I remake it in new position and it is positioned right next to image2 but after 3 or 4 time of positioning, the images start to have distance between each other.How can I have them stick together again?

Code:
if (bGround1.frame.origin.x <= -viewWidth) {
        bGround1.frame = CGRectMake
        (viewWidth, 0, bGround1.frame.size.width, bGround1.frame.size.height);}

if (bGround2.frame.origin.x <= -viewWidth) {
        bGround2.frame = CGRectMake
        (viewWidth, 0, bGround2.frame.size.width, bGround2.frame.size.height);}
B72UY.png
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.