Files
wf/source/Hands/SimpleHands.mc
2025-11-07 16:31:23 +02:00

26 lines
708 B
MonkeyC

import Toybox.Graphics;
import Toybox.Lang;
class SimpleHands extends IHands {
function initialize(options as IHands.HandsParams) {
IHands.initialize(options);
}
function drawHand(dc as Dc, x as Float, y as Float, length as Float) as Void {
var angle = Math.toRadians(getAngle(null) - 90);
length *= getLenght(Type);
dc.setColor(Color, Color);
dc.drawLine(x, y, x + length * Math.cos(angle), y + length * Math.sin(angle));
}
private function getLenght(handType as IHands.HandType) as Float {
switch (handType) {
case HOURS_HAND:
return 0.7;
default:
return 1.0;
}
}
}