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 8223425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:41:32+00:00 2026-06-07T14:41:32+00:00

I am creating a rotating knob button in iOS. The graphics designer gave me

  • 0

I am creating a rotating knob button in iOS. The graphics designer gave me png layers so I am using an image context to allow blending of the layers.

On rotations, only some of the layers get rotated. My goal is to animate these rotations.

Currently, I am using

- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
- (BOOL)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event

in these methods I compute the required rotation of the image and draw it.

This works fine. The hurdle I have is that in

- (BOOL)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event

I want to do a “snap to” animation. How can I do this?
I am not sure how I can use an affine transformation in this case due to the blending. The following method is how I build the image:

- (UIImage *)knobImageWithRadians:(float)radians
{
UIImage *i05 = [UIImage imageNamed:@"05 - Metal Over Empty Space - ROTATE ME.png"];
UIImage *i04 = [UIImage imageNamed:@"04 - Inner Knob.png"];
UIImage *i03 = [UIImage imageNamed:@"03 - Over Knob Metal - (OVERLAY BLEND)  - ROTATE ME.png"];
UIImage *i02 = [UIImage imageNamed:@"02 - Numbers and Dashes - ROTATE ME.png"];
UIImage *i01 = [UIImage imageNamed:@"01 - Reflective Overlay - (COLOR DODGE BLEND).png"];

CGSize size = i11.size;     

UIGraphicsBeginImageContext(size);
CGContextRef bitmap = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(bitmap, size.width/2, size.height/2);


[i04 drawInRect:CGRectMake(-i04.size.width/2, -i04.size.height/2, i04.size.width, i04.size.height) blendMode:kCGBlendModeNormal alpha:1.0];

CGContextRotateCTM(bitmap, radians);
[i03 drawInRect:CGRectMake(-i03.size.width/2, -i03.size.height/2, i03.size.width, i03.size.height) blendMode:kCGBlendModeOverlay alpha:1.0];

[i02 drawInRect:CGRectMake(-i02.size.width/2, -i02.size.height/2, i02.size.width, i02.size.height) blendMode:kCGBlendModeNormal alpha:1.0];
CGContextRotateCTM(bitmap, -radians);

[i01 drawInRect:CGRectMake(-i01.size.width/2, -i01.size.height/2, i01.size.width, i01.size.height) blendMode:kCGBlendModeColorDodge alpha:1.0];

UIImage* blendedImage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

return blendedImage;
}

UPDATE:

right now, I am simply letting it snap directly without any animation.

  • 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-07T14:41:34+00:00Added an answer on June 7, 2026 at 2:41 pm

    You’ll have to animate this yourself by periodically redrawing the image at the new angle. OR come up with visuals that only use source over compositing so you can have each image in a separate layer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this tutorial: http://mobile.tutsplus.com/tutorials/android/android-sdk-creating-a-rotating-dialer/ Which gives me a rotating dialer based on
I am a bit stuck. I am creating a rotating background image with jquery
I'm creating an ios painting app for iOS and having the hardest time rotating
Creating a JApplet I have 2 Text Fields, a button and a Text Area.
Creating a simple RPG game, first time using XNA. Trying to get my character
Creating a calculator-like dialog, I noticed that quickly clicking on a button in IE
Creating a table without tbody using javascript createElement/appendChild will not add tbody in Firebug
Creating sprite sheets aka texture atlases rather than using many hundres of individual images
Creating a site in with FrogCMS and using alot of jquery to create an
I'm creating a Quicktime movie file using AVAssetWriter . Currently the output video is

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.