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

  • Home
  • SEARCH
  • 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 133665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:28:26+00:00 2026-05-11T06:28:26+00:00

I’m trying to animate some UIImageViews for a 2D game. Using [UiView begin/commit animation]

  • 0

I’m trying to animate some UIImageViews for a 2D game. Using [UiView begin/commit animation] is out of the question, since I need to determine the positions of all Image Views at all times. Instead I’m changing the frame.origin.x/y in my UIImageViews to manualy control my animations. My problem is that the framerate drops significantly for high numbers of UIImageViews or if their size is too large (btw, the UIImageViews contain PNGs with transparency colours). Do you have any optimization advices?

Thanks

  • 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. 2026-05-11T06:28:26+00:00Added an answer on May 11, 2026 at 6:28 am

    UIImageView is just fine for animating about the display (UIViews are lightweight wrappers around CALayers, which are just textures stored on the graphics card), but you do need to use the begin / commit animation block to get smooth animation. Using that, you can retrieve the current position of the view by accessing the backing layer of the UIView and obtaining its presentation layer. Dustin Bachrach has a post that describes just how to do this. Basically, the presentation layer is Core Animation’s closest approximation to where the actual layer is at any given time, so its frame is the frame of your UIView at that instant.

    I’m not sure that touch events will find their way to the view as it’s moving across the screen, so if you need to have the UIImageView respond to touches you may need to replace it with a CALayer, insert it as a sublayer of your main UIView’s layer, and call the hitTest method on the presentationLayer of that main layer. That should return the presentationLayer of your moving layer if it was clicked on, or the background layer if not.

    Honestly, I wouldn’t go with OpenGL unless you absolutely had to for performance reasons, because it is a lot harder to code for than what Core Animation provides you with UIViews and CALayers. I’ve been able to animate 50 moving translucent layers at 60 FPS (100 at 30 FPS) using just UIViews and CALayers.

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

Sidebar

Ask A Question

Stats

  • Questions 103k
  • Answers 103k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer see: http://www.switchonthecode.com/tutorials/cakephp-part-6-pagination and https://book.cakephp.org/3/en/views/helpers/paginator.html What stands out here is that… May 11, 2026 at 8:21 pm
  • Editorial Team
    Editorial Team added an answer http://msdn.microsoft.com/en-us/library/aa751792.aspx There you go - the how to from Microsoft May 11, 2026 at 8:21 pm
  • Editorial Team
    Editorial Team added an answer Provided you know the string is definitely a date I… May 11, 2026 at 8:21 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.