Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
def slideDown(height: int, settings: Settings, canvas: Canvas,
              scrollSpeed: float):
    delta = height + int(int(settings.windowSettings.height) / 2)
    moveAllCanvasElements(delta, canvas, 0, 1, scrollSpeed)
Beispiel #4
0
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)