Edgescroll speed
Posted: Fri Oct 09, 2020 8:29 am
I'm trying to make a map where you can look around in by moving your cursor to the edge of the screen.
However, right now the speed at which the map moves is really slow.
The wiki says:
However, right now the speed at which the map moves is really slow.
The wiki says:
Can someone give me an example of how to do this? An old thread already got me started with:If present, the third element is a function that adjusts the scrolling speed, based on how close to the pointer is to an edge. The function should take a number between -1.0 and 1.0, and return a number in the same range. The default function returns its input, and implements proportional scrolling. A function that returned -1.0 or 1.0 based on the sign of its input would implement constant-speed scrolling.
Code: Select all
init python:
def speed_scroll(i):
return i
screen city():
viewport:
edgescroll (400, 500, speed_scroll)