How to rotate needle in FMXCompass

Hello,
in TMS Instrumentation Workshop I can rotate the needle with heading := xy; How can i rotate the needle in FMS Instrumentation Compass?

rgds Frank

Did you try the TTMSFMXCompass.RotationAngle property?

Yes, of course, but that turns the entire compass rose and not just the needle. The needle points to north.

I'm not sure I understand. On a compass, the needle always points to the north.

Yes, but if you turn the compass the text under the needle is maybe SW or NW or S. Take a look at the VCL Compass component (Heading)

For the FMXCompass I can simply use a picture of a compass rose, which has the same functionality.

Hi, 


To rotate the needle, you can use the following code:
type
  TTMSFMXCompassProtected = class(TTMSFMXCompass);

implementation
...
  TTMSFMXCompassProtected(TMSFMXCompass1).Value := 5;

The needle is set at 25 by default. The range is 0 to 100 starting from the West.

Kind Regards, 
Pieter

Thank you, but I have already found another solution.

Var Nadel : TFMXObject;

  nadel := compass.FindStyleResource('needle');
  if (nadel <> nil) then TTMSFMXCompass(Nadel).RotationAngle :=angle;
  compass.Repaint;

Hi, 


You can also set the rotationangle directly with: 

  TMSFMXCompass1.GetNeedle.RotationAngle

Kind Regards, 
Pieter