Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8284657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:11:13+00:00 2026-06-08T11:11:13+00:00

I am separating the screen into small tiles, then animating each tile to perform

  • 0

I am separating the screen into small tiles, then animating each tile to perform a transition:

    for (int x=0; x<number_of_x_splits; x++) {

    for (int y=0; y<number_of_y_splits; y++) {

        CGSize splitSize = CGSizeMake(screenBounds.width / number_of_x_splits, screenBounds.height / number_of_y_splits);

        CATransformLayer *transformLayer = [CATransformLayer layer];
        [transformLayer setFrame:CGRectMake(splitSize.width * x, splitSize.height * y, splitSize.width, splitSize.height)];
        [transformLayer setPosition:CGPointMake((splitSize.width * x) + splitSize.width / 2, (splitSize.height * y) + splitSize.height / 2)];

        ... adding some sublayers to transformLayer...

        CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];
        [rotate setDuration:5.0];
        [rotate setFromValue:[NSNumber numberWithFloat:0]];
        [rotate setToValue:[NSNumber numberWithFloat:M_PI]];
        [rotate setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
        [rotate setTimeOffset:(1 / (number_of_x_splits + number_of_y_splits)) * (x+y)];
        [rotate setFillMode:kCAFillModeForwards];
        [rotate setRemovedOnCompletion:NO];
        [transformLayer addAnimation:rotate forKey:@"transform.rotation.y"];

    }
}

The problem is that only the last CALayer in the chain remains at final position.
I have also tried to set the CALayer final transform value:

[transformLayer setTransform:CATransform3DMakeRotation(M_PI, 0, 1, 0)];

I guess it have to do with creating another instance of CALayer in the loop reset the properties of the previous layer.

Anyone have a suggestion how to remedy the situation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:11:15+00:00Added an answer on June 8, 2026 at 11:11 am

    timeOffset is not the property you want to use, that actually changes at what point into the animation it will begin and not the delay until it starts. Instead you should set the beginTime of the animation.

    Remember that the begin time should be CACurrentMediaTime() + yourDelay


    The difference between timeOffset and beginTime can be illustrated like this. I know I’ve seen this illustration before, I just couldn’t find it.

    Normal animation    | 12345678 |
    Begin time          |     12345678 |
    Time offset         | 5678     |
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SOLUTION: Simply separating the method call Tile *tile = [[Tile alloc] initWithX:x Y:y]; into
Should I be separating my js for each page assuming there is no overlap
Am separating my delphi code into interface and implementation units ie. EmployeeIntf.pas looks like
I'm using tabitems for separating some information but as each one has different information,
I want to have 3 rows in the grid, then a thicker line separating
While separating business logic and data access logic into two different assemblies, I want
Does separating CSS code into multiple declarations cause more overhead for users? I have
I am separating some XHTML from PHP by putting the XHTML into a separate
I am separating out logical sections into fragment *.wxs files, but how do I
What is an elegant way of separating the console input (or a string) into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.