def slideRight(settings: Settings, width: int, canvas: Canvas, scrollSpeed: float, alignment: str): delta = 0 if alignment == "Left": delta = int(settings.windowSettings.width) elif alignment == "Right": delta = width elif alignment == "Center": center = int(int(settings.windowSettings.width) / 2) delta = center + int(width / 2) moveAllCanvasElements(delta, canvas, 1, 0, scrollSpeed)
def slideLeft(settings: Settings, canvas: Canvas, scrollSpeed: float, width: int, alignment: str): delta = 0 if alignment == "Left": delta = int(settings.windowSettings.width) + 1 elif alignment == "Right": delta = width + 1 elif alignment == "Center": center = int(int(settings.windowSettings.width) / 2) delta = center + int(width / 2) + 1 if int(settings.windowSettings.width) % 2 == 1: delta += 1 moveAllCanvasElements(delta, canvas, -1, 0, scrollSpeed)
def slideDown(height: int, settings: Settings, canvas: Canvas, scrollSpeed: float): delta = height + int(int(settings.windowSettings.height) / 2) moveAllCanvasElements(delta, canvas, 0, 1, scrollSpeed)
def slideUp(height: int, settings: Settings, canvas: Canvas, scrollSpeed: float): delta = height + int(int(settings.windowSettings.height) / 2) if int(settings.windowSettings.height) % 2 == 1: delta += 1 moveAllCanvasElements(delta, canvas, 0, -1, scrollSpeed)