initial commit
This commit is contained in:
26
source/Hands/BatonHand.mc
Normal file
26
source/Hands/BatonHand.mc
Normal file
@ -0,0 +1,26 @@
|
||||
import Toybox.Graphics;
|
||||
import Toybox.Lang;
|
||||
|
||||
class BatonHand extends IHand {
|
||||
|
||||
function initialize(options as IHand.HandParams) {
|
||||
IHand.initialize(options);
|
||||
}
|
||||
|
||||
function drawHand(dc as Dc, start as Point2D, length as Float) as Void {
|
||||
var angle = Math.toRadians(getAngle(null) - 90);
|
||||
var direction = [Math.cos(angle), Math.sin(angle)] as Point2D;
|
||||
|
||||
// body part
|
||||
dc.setColor(Color, Color);
|
||||
fillSuperellipse(dc, start, direction, length, Width);
|
||||
|
||||
// fill
|
||||
dc.setColor(BackgroundColor, BackgroundColor);
|
||||
var holeStart = [
|
||||
start[0] + direction[0] * length * 0.33,
|
||||
start[1] + direction[1] * length * 0.33
|
||||
] as Point2D;
|
||||
fillSuperellipse(dc, holeStart, direction, length * 0.66, Width * 0.66);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user