<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Animation in the Time of Tiger: Part 2</title>
	<atom:link href="http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/</link>
	<description>On Mac OS X programming</description>
	<pubDate>Tue, 02 Dec 2008 12:06:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: mr_noodle</title>
		<link>http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-5004</link>
		<dc:creator>mr_noodle</dc:creator>
		<pubDate>Thu, 13 Sep 2007 03:21:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-5004</guid>
		<description>Kelan: Thanks for the comments. Yes, there are things you may need to do to optimize it as the views will get redrawn. For some types of animations this is unavoidable (like you are resizing a view and want it to re-layout its subviews as it resizes) but in others, where you are basically just moving it, you would probably want to use a bitmap of the view. My next post in the series is going to talk about that (but yes, in general, this means not being able to use NSViewAnimation).

Or you could just use MGViewAnimation, as Joe suggests.</description>
		<content:encoded><![CDATA[<p>Kelan: Thanks for the comments. Yes, there are things you may need to do to optimize it as the views will get redrawn. For some types of animations this is unavoidable (like you are resizing a view and want it to re-layout its subviews as it resizes) but in others, where you are basically just moving it, you would probably want to use a bitmap of the view. My next post in the series is going to talk about that (but yes, in general, this means not being able to use NSViewAnimation).</p>
<p>Or you could just use MGViewAnimation, as Joe suggests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4820</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Sun, 09 Sep 2007 01:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4820</guid>
		<description>Kelan, you can try out Matt Gemmell's MGViewAnimation.  Its far more performant than NSViewAnimation.  http://mattgemmell.com/2006/11/13/mgviewanimation</description>
		<content:encoded><![CDATA[<p>Kelan, you can try out Matt Gemmell&#8217;s MGViewAnimation.  Its far more performant than NSViewAnimation.  <a href="http://mattgemmell.com/2006/11/13/mgviewanimation" rel="nofollow">http://mattgemmell.com/2006/11/13/mgviewanimation</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kelan Champagne</title>
		<link>http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4797</link>
		<dc:creator>Kelan Champagne</dc:creator>
		<pubDate>Sat, 08 Sep 2007 09:19:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4797</guid>
		<description>Wow, nice.  Thanks for this example.  And what perfect timing!  I was planning on trying to implement exactly this effect tonight, and it was great to have an example to follow.

I have noticed an issue, and was wondering if you had any thoughts.  I am doing the "Push" transition, with 2 views that have a solid background, and I want their edges to be touching.  It looks like frames of the animation are drawn where one view has moved, but the other hasn't, so that there is a gap between the two views, or they can be overlapped slightly.

To recreate this your example, I edited the nib to make each of your subviews have a solid color in the background (by putting a NSTextView behind everything, making it the full size of the view, setting its background color, and turning off the scrollbar), and put another solid background behind everything in the main window in the same way (preferable all different colors).  Then I slowed down the animation by putting
	[animation setDuration:(NSTimeInterval)3.0];
in Controller.m:203.  Then do the push transition, and you can see it, but only on every other swap (I think because you can only tell when they have a gap, and not when they overlap).  I was wondering if you knew of any tricks to sync the animation, or otherwise deal with this.  The weird thing is that if you don't put that background in the main window (and just put a background on each subview), then you don't see any gap.  Maybe there is another subtlety that's causing this?

Also, are there any tricks to make the animation run smoother?  Mine are pretty choppy, especially when the window is big.  It looks like the subviews are getting redrawn at each step of the animation (though, I'm not sure what exactly is triggering the redraw.  Should it not be doing this?).  To reduce the cost of redrawing, I was thinking of creating a NSImage with a bitmap snapshot of each subview, and animating with those instead.  Or somehow otherwise manually forcing them not to draw themselves during the animation.  Or am I just doing something wrong?  Alternatively, I could put the subviews side-by-side in an NSClipView and just scroll that (with setCopiesOnScroll:YES), but then I miss out on all this nice NSViewAnimation stuff.

Finally, you mention the CI transitions, and I've played with some of those (from the example code here: http://dev.lipidity.com/apple/core-graphics-meet-core-image-demo-app ), but all of the non-cheesy transitions are the CG ones, which move the whole window.  Do you know if there is a way to do the CG transitions (CGFade, CGSlide, etc) just within the window bounds?

Thanks again for this example.</description>
		<content:encoded><![CDATA[<p>Wow, nice.  Thanks for this example.  And what perfect timing!  I was planning on trying to implement exactly this effect tonight, and it was great to have an example to follow.</p>
<p>I have noticed an issue, and was wondering if you had any thoughts.  I am doing the &#8220;Push&#8221; transition, with 2 views that have a solid background, and I want their edges to be touching.  It looks like frames of the animation are drawn where one view has moved, but the other hasn&#8217;t, so that there is a gap between the two views, or they can be overlapped slightly.</p>
<p>To recreate this your example, I edited the nib to make each of your subviews have a solid color in the background (by putting a NSTextView behind everything, making it the full size of the view, setting its background color, and turning off the scrollbar), and put another solid background behind everything in the main window in the same way (preferable all different colors).  Then I slowed down the animation by putting<br />
	[animation setDuration:(NSTimeInterval)3.0];<br />
in Controller.m:203.  Then do the push transition, and you can see it, but only on every other swap (I think because you can only tell when they have a gap, and not when they overlap).  I was wondering if you knew of any tricks to sync the animation, or otherwise deal with this.  The weird thing is that if you don&#8217;t put that background in the main window (and just put a background on each subview), then you don&#8217;t see any gap.  Maybe there is another subtlety that&#8217;s causing this?</p>
<p>Also, are there any tricks to make the animation run smoother?  Mine are pretty choppy, especially when the window is big.  It looks like the subviews are getting redrawn at each step of the animation (though, I&#8217;m not sure what exactly is triggering the redraw.  Should it not be doing this?).  To reduce the cost of redrawing, I was thinking of creating a NSImage with a bitmap snapshot of each subview, and animating with those instead.  Or somehow otherwise manually forcing them not to draw themselves during the animation.  Or am I just doing something wrong?  Alternatively, I could put the subviews side-by-side in an NSClipView and just scroll that (with setCopiesOnScroll:YES), but then I miss out on all this nice NSViewAnimation stuff.</p>
<p>Finally, you mention the CI transitions, and I&#8217;ve played with some of those (from the example code here: <a href="http://dev.lipidity.com/apple/core-graphics-meet-core-image-demo-app" rel="nofollow">http://dev.lipidity.com/apple/core-graphics-meet-core-image-demo-app</a> ), but all of the non-cheesy transitions are the CG ones, which move the whole window.  Do you know if there is a way to do the CG transitions (CGFade, CGSlide, etc) just within the window bounds?</p>
<p>Thanks again for this example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mr_noodle</title>
		<link>http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4663</link>
		<dc:creator>mr_noodle</dc:creator>
		<pubDate>Tue, 04 Sep 2007 19:44:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4663</guid>
		<description>Steven: Looks like Tom beat me to the punch. But thanks for your comments.

Tom: I was actually going to bring up the Reducer example in my next article as I was going to mention the CoreImage transition filters. I'll probably still talk about it but the surprise is blown. Maybe I'll throw in some OpenGL...</description>
		<content:encoded><![CDATA[<p>Steven: Looks like Tom beat me to the punch. But thanks for your comments.</p>
<p>Tom: I was actually going to bring up the Reducer example in my next article as I was going to mention the CoreImage transition filters. I&#8217;ll probably still talk about it but the surprise is blown. Maybe I&#8217;ll throw in some OpenGL&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Harrington</title>
		<link>http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4661</link>
		<dc:creator>Tom Harrington</dc:creator>
		<pubDate>Tue, 04 Sep 2007 17:28:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4661</guid>
		<description>Steven, you just drag a "custom view" into the instances tab of the nib contents window.  Those views aren't sitting in windows, they're just freestanding views.  IB shows them in windows for convenience but they only show up in the app because they get added as subviews.

Mr. Noodle, thanks for this.  I was not aware of NSView's -setAutoresizingMask:, and I'm sure it'll come in handy.

A related example is Apple's "Reducer" demo code, which includes an NSTabView subclass that animates transitions between its views.  It's on Apple's site at http://developer.apple.com/samplecode/Reducer/index.html</description>
		<content:encoded><![CDATA[<p>Steven, you just drag a &#8220;custom view&#8221; into the instances tab of the nib contents window.  Those views aren&#8217;t sitting in windows, they&#8217;re just freestanding views.  IB shows them in windows for convenience but they only show up in the app because they get added as subviews.</p>
<p>Mr. Noodle, thanks for this.  I was not aware of NSView&#8217;s -setAutoresizingMask:, and I&#8217;m sure it&#8217;ll come in handy.</p>
<p>A related example is Apple&#8217;s &#8220;Reducer&#8221; demo code, which includes an NSTabView subclass that animates transitions between its views.  It&#8217;s on Apple&#8217;s site at <a href="http://developer.apple.com/samplecode/Reducer/index.html" rel="nofollow">http://developer.apple.com/samplecode/Reducer/index.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Noyes</title>
		<link>http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4659</link>
		<dc:creator>Steven Noyes</dc:creator>
		<pubDate>Tue, 04 Sep 2007 17:02:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4659</guid>
		<description>Quick question and not to sound dumb.  When looking at your NIB file, you have your two custom views sitting in a window but I find no associated Window object that they belong to.  I have always had to create a "dead" window and put my views in that grouped by a box view (with no borders).  How did you create the free standing views View and View1????

Steven</description>
		<content:encoded><![CDATA[<p>Quick question and not to sound dumb.  When looking at your NIB file, you have your two custom views sitting in a window but I find no associated Window object that they belong to.  I have always had to create a &#8220;dead&#8221; window and put my views in that grouped by a box view (with no borders).  How did you create the free standing views View and View1????</p>
<p>Steven</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Noyes</title>
		<link>http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4654</link>
		<dc:creator>Steven Noyes</dc:creator>
		<pubDate>Tue, 04 Sep 2007 05:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.noodlesoft.com/blog/2007/09/03/animation-in-the-time-of-tiger-part-2/#comment-4654</guid>
		<description>So cool.  I was wanting something like this just the other day to help me save real-estate on some controls.  I wanted something a bit classier than a tabbed interface...

Let me think.....</description>
		<content:encoded><![CDATA[<p>So cool.  I was wanting something like this just the other day to help me save real-estate on some controls.  I wanted something a bit classier than a tabbed interface&#8230;</p>
<p>Let me think&#8230;..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
