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

Re: Small animation


  • Subject: Re: Small animation
  • From: Lorenzo <email@hidden>
  • Date: Wed, 21 Jan 2004 20:18:49 +0100

Yes, exactly! The train of chars seemed to be a worm...
I am going to start a search for it. TY.

What so you mean with "don't move the view around"?
Some code...?


Best Regards
--
Lorenzo
email: email@hidden

> From: Alexander Spohr <email@hidden>
> Date: Wed, 21 Jan 2004 20:14:50 +0100
> To: Lorenzo <email@hidden>
> Cc: email@hidden
> Subject: Re: Small animation
>
> lorenzo,
>
> don't move the view around! draw what you want at the place you want
> inside your view. but do not move views around.
>
> the demo your'e looking for is called Worm. i found it some days ago,
> but forgot where it was.
>
> atze
>
>
> Am 21.01.2004 um 17:28 schrieb Lorenzo:
>
>> Hi,
>> I would like to animate an NSImageView on the screen. Just a small
>> animation. So I don't want to use openGL because it's not easy and it
>> requires modern Video Boards.
>>
>> I remember a sample at the WWDC 2001 which showed how to the speed-up
>> an
>> animation. There was a "train" of characters rotating along the
>> borders of
>> the window. I remember that animation was so fast, smooth and fine.
>> Even
>> faster at any new concept introduced by the speaker-man.
>>
>> And I cannot get that nice result. The image flicks. Can you show me
>> the
>> finest way to animate my image? Thank you.
>>
>> I did the following rude code:
>> ------------------------------
>> In my NSView subclass I have a timer that each 0.005 NSTimeInterval
>> calls
>> "updateView" method.
>>
>> - (void)updateView
>> {
>> x++;
>> y++;
>>
>> [imageView setFrameOrigin:NSMakePoint(x, y)];
>>
>> NSRect theRect = [imageView frame];
>> theRect.origin.x -= 1;
>> theRect.origin.y -= 1;
>> theRect.size.width += 2;
>> theRect.size.height += 2;
>> [self setNeedsDisplayInRect:theRect];
>> }
>>
>>
>> // ---------------------------------------------------------
>> // drawRect
>> // ---------------------------------------------------------
>> - (void)drawRect:(NSRect)rect
>> {
>> [gBackgroundColor set];
>> NSRectFill([self bounds]);
>> }
>>
>>
>>
>>
>> Best Regards
>> --
>> Lorenzo
>> email: email@hidden
>> _______________________________________________
>> cocoa-dev mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Small animation (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Best way to defy logic of NSTextField editing
  • Next by Date: Re: NSSearchField loses focus
  • Previous by thread: Re: Small animation
  • Next by thread: Re: Small animation
  • Index(es):
    • Date
    • Thread