initialize method
Implementation
void initialize(Vector2 screenSize, JoystickController joystickController) {
_screenSize = screenSize;
_joystickController = joystickController;
Offset osBackground = Offset(
margin.left,
screenSize.y - margin.bottom,
);
_backgroundRect = Rect.fromCircle(
center: osBackground,
radius: size / 2,
);
Offset osKnob = Offset(
_backgroundRect!.center.dx,
_backgroundRect!.center.dy,
);
_knobRect = Rect.fromCircle(
center: osKnob,
radius: size / 4,
);
_dragPosition = _knobRect!.center;
}