Re: How do I animate Core Graphics drawing?
Re: How do I animate Core Graphics drawing?
- Subject: Re: How do I animate Core Graphics drawing?
- From: Vanni Parronchi <email@hidden>
- Date: Thu, 13 Feb 2014 10:04:35 +0100
Hi Rick,
How about putting the barbell image as the contents of a stock CALayer and
use the contentsCenter property to stretch the barbell in the middle
letting CALayer replicating the middle column of pixels as needed?
In this way you should be able to leverage Core Animation fast compositing
and you could even use only one source image (the barbell one) that you
could share among all the layers in the floor plan and not waste much
memory space.
The barbell layer could then be scaled or rotated using standard CA affine
transforms.
Does it sounds like a viable solution to you (or others)? Maybe i'm just
ranting, i didn't do a proof of concept test yet...
PS: i think the wwdc video you were mentioning is session #213 of 2013
2014-02-12 1:20 GMT+01:00 <email@hidden>:
> If you don't find it first, I'll post the link later.
> It talks about creating custom default animations for a custom view.
> They show a simple example of a red rect path animation the stroke width.
>
> Unfortunately asciiwwdc doesn't include the text of the PDFs associated
> with each video as far as I can tell and is just taking the transcript.
> The transcripts also are clearly automated (when provided by Apple as
> closed captions) and not always accurate. These things might hinder some
> searches.
> But even the PDFs don't include things like presenter notes and are
> sometimes very rough exports from Keynote.
>
> Sent from my iPhone
>
> > On 2014/02/12, at 9:08, Rick Mann <email@hidden> wrote:
> >
> >
> >> On Feb 11, 2014, at 15:58 , email@hidden wrote:
> >>
> >> I don't recall the title but there was a recent WWDC video that
> includes this topic.
> >> It's not a one step process but not that hard either.
> >
> > Thanks. I searched asciiwwdc.com, but there are MANY videos discussing
> animation, and it wasn't clear which one I should watch. I'll look again
> when I have more time.
> >
> > Wish they had outlines.
> >
> >>
> >> Sent from my iPhone
> >>
> >>> On 2014/02/12, at 8:43, Rick Mann <email@hidden> wrote:
> >>>
> >>> In my app, I annotate a floor plan with lines of arbitrary length and
> location, capped with circles (like stretchy barbells). The UZ design calls
> for collapsing these into a single circle placed at the center of the line
> when they're not being edited. There can be many (probably not more than 10
> or 20) of these lines scattered over the floor plan.
> >>>
> >>> I'd like to animate the collapse and expansion of these barbells, all
> at a time. They do not live in their own views, but rather are drawn in one
> large overlay view that spans the screen, in -drawRect:.
> >>>
> >>> Can I leverage Core Animation, or should I just make a timer and
> animate it myself (by repeatedly calling -setNeedsDisplay on my overlay
> view)?
> >>>
> >>> I could try to make these drawn with CAShapeLayers, but during
> editing, the user can drag one end or the other around arbitrarily. A layer
> that just bounds the barbell would have to dynamically change size as the
> user does this, or be sized full-screen, which might consume a lot of
> memory; I'm not sure.
> >>>
> >>> --
> >>> Rick
> >
> >
> > --
> > Rick
> >
> >
> >
>
> _______________________________________________
>
> 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
>
_______________________________________________
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