4

In a Firemonkey 2d application, I'm using a float key to attempt to move a TLine control around a clock. I've added 60 key frames for the minute hand and 12 key frames for the hour hand (actually it's a lot more keys because I added one on position x, position y, height and width).

So, now I have two questions:

  1. How do I play to a key frame, then start at a key frame and go to the next key frame?

  2. How do I go to a particular key frame? (i.e. I load a form and I want to show the current time)

Firemonkey Clock

Note, I'm doing this just to learn more about Delphi XE2, not to solve any particular business solution.

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Peter Turner
  • 11,199
  • 10
  • 68
  • 109

1 Answers1

1

I haven't tried it but.

You could use perhaps use TAnimations procedure

procedure ProcessTick(time, deltaTime: Single);

And call it right after you start your animation from scratch with a deltatime that will place you at the correct key.

Note that the function includes a time parameter too but that one seem to be ignored in code, otherwise you could probably use that to set the current time.

PeterS
  • 206
  • 1
  • 11