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