• 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: CATextLayer question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CATextLayer question


  • Subject: Re: CATextLayer question
  • From: John Clayton <email@hidden>
  • Date: Wed, 14 Nov 2007 07:39:59 +0100

Actually, I'm going to back on up a wee bit.

I am writing an app that composes various bits of media together using the CAnim system to store the composition model. The CA system has a really nice fit for this, i.e. layering, beginTime, duration, super/ child relationships, layout mgrs, child positioning relative to parent - all the kind of stuff that makes modelling media in space *and* time relatively easy.

For this app, I need to be able to describe my model (i.e. a piece of text that has a duration of 10 seconds), and then to be able to place that text into the root CALayer instance with a beginTime of Z (which is arbitrary).

I'm then using a custom rendering solution that renders a single frame of any arbitrary CALayer at any given point in time to pick out an image (based on CALayerRenderer).

Does this mean I'd have to set my root layer beginTime to the following (note the minus):

	( - CACurrentMediaTime() + aTimeThatIWantToRenderAt )

in order to see the frame? Seems so... because the internal CACurrentMediaTime() is ticking away quite happily in the background, whereas I want to render at a given point in time, regardless of what the CACurrentMediaTime() value is.

I will try this out anyway...

--
John Clayton


On 14/11/2007, at 7:13 AM, John Clayton wrote:

Correct, thanks. I modified the program to include a button that reset the beginTime to the CACurrentMediaTime() value, and then when I type something into the duration (like 4) the text appears, and after 4 seconds, fades out.

Thanks for the tip.

--
John Clayton
http://www.coderage-software.com/


On 13/11/2007, at 11:45 PM, David Duncan wrote:

On Nov 13, 2007, at 1:41 PM, John Clayton wrote:

I have an issue with CATextLayer that I'd like to explore. The basic question is this: why does a CATextLayer that has a 'duration' specified for it, not draw anything?


Because the beginTime attribute is sometime in the past, likely the distant past. Since the sum of the beginTime and your duration says that the animation has expired, the layer is hidden. Generally, if you want to set a layer's duration, you should also set its beginTime.
--
David Duncan
Apple DTS Animation and Printing
email@hidden





_______________________________________________

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:
@mac.com


This email sent to email@hidden

_______________________________________________

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: 
 >CATextLayer question (From: John Clayton <email@hidden>)
 >Re: CATextLayer question (From: David Duncan <email@hidden>)
 >Re: CATextLayer question (From: John Clayton <email@hidden>)

  • Prev by Date: Re: Custom Cell For NSTableView & Bindings
  • Next by Date: Re: Custom Cell For NSTableView & Bindings
  • Previous by thread: Re: CATextLayer question
  • Next by thread: Core Data: Cross-Model Relationships
  • Index(es):
    • Date
    • Thread