• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Animation. issue with scaling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Animation. issue with scaling


  • Subject: Re: Core Animation. issue with scaling
  • From: Eric Wing <email@hidden>
  • Date: Mon, 23 Aug 2010 00:39:30 -0700

>> I'm not sure how you are detecting touches now, but you should look at
>> using CALayer's hitTest: method to determine if/what layer was
>> clicked/touched. If the animation is still moving, you definitely need
>> to be querying the presentationLayer and not the modelLayer.
>>
>>
> I am detecting touches in UIView/ UIViewController  as only these two are
> inherited from UIResponder. I am able to detect touches but after applying
> core animation on layers the touches do not move, they stay where they were
> before the animation, so if i click new position of layer nothing happens.
> "IF" I do not explicitly change the properties of layer position (as given
> in the code i quoted, forget the bounds code i have written) etc...

So you would probably want to override the touch events in your
UIView, and pass the touch location to the view's CALayer hitTest
method to see if you get a hit in any of the contained layers.


>> Otherwise, your alternative is to manually change the bounds and
>> positions for each and every one of your layers. As I said, changing
>> the bounds of a parent layer will not change the bounds of a child
>> layer. Bounds is not a scale property. They are subtly different
>> things.
>>
> Hi, can you please elaborate a bit, you said otherwise (means with out
> hittest?). Yes I am clear on bounds issue.

There's no magic here. I'm just saying instead of scaling the parent
layer, you traverse through all your views/layers and manually set the
bounds (and position) of each one individually. So if you want to
"scale" everything by 50%, you traverse through every view/layer in
your app and change each individual bounds property so each width and
height are half of what they were before. (You may also need to adjust
the positions if your positions are relative to one another.) Assuming
everything is a UIView and not a CALayer, this technique really has
nothing to do with Core Animation. I'm sure you already thought of
doing this. It's tedious and not much fun, but it may get the job done
in your case.

-Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Core Animation. issue with scaling (From: Ahsan Shafiq <email@hidden>)
 >Re: Core Animation. issue with scaling (From: Eric Wing <email@hidden>)
 >Re: Core Animation. issue with scaling (From: Ahsan Shafiq <email@hidden>)
 >Re: Core Animation. issue with scaling (From: Eric Wing <email@hidden>)
 >Re: Core Animation. issue with scaling (From: Ahsan Shafiq <email@hidden>)

  • Prev by Date: Re: decodeObjectForKey without definition
  • Next by Date: Re: NSArrayController + KVO + Core Data Question
  • Previous by thread: Re: Core Animation. issue with scaling
  • Next by thread: NSTextView rotation issues
  • Index(es):
    • Date
    • Thread