Accelerated touch screen scrolling
Posted: Sun Feb 03, 2013 4:03 am
I've followed the online instructions to get the touch screen to move in an accelerated
fashion with the below code. I'm obviously missing something as it does not happen
#Note: this is to run on a Samsung Galaxy Tablet 2
# only the vertical scroll is required so the horizontal scroll script is commented out
on preOpenStack
set the compositorType of this stack to "software"
set the compositorTileSize of this stack to 32
set the compositorCacheLimit of this stack to (16 * 1024 * 1024)
set the layerMode of group "group id 1050" to "scrolling"
end preOpenStack
local sScrolling
local sInitialMouseX, sInitialMouseY
local sInitialHScroll, sInitialVScroll
on mouseDown
## Allow the group to scroll
put true into sScrolling
## Record the initial touch position
put item 1 of the mouseLoc into sInitialMouseX
put item 2 of the mouseLoc into sInitialMouseY
## Record the initial hScroll and vScroll
put the vScroll of me into sInitialVScroll
put the hScroll of me into sInitialHScroll
end mouseDown
on mouseMove mouseX, mouseY
## If the screen is being touched then
if sScrolling then
## Calculate how far the touch has moved since it started
put mouseY - sInitialMouseY into tVChange
# put mouseX- sInitialMouseX into tHChange
## Reset the hScroll and vScroll to follow the touch
lock screen
set the vScroll of me to sInitialVScroll - tVChange
# set the hScroll of me to sInitialHScroll - tHChange
unlock screen
end if
end mouseMove
on mouseRelease
mouseUp
end mouseRelease
on mouseUp
put false into sScrolling
end mouseUp
fashion with the below code. I'm obviously missing something as it does not happen
#Note: this is to run on a Samsung Galaxy Tablet 2
# only the vertical scroll is required so the horizontal scroll script is commented out
on preOpenStack
set the compositorType of this stack to "software"
set the compositorTileSize of this stack to 32
set the compositorCacheLimit of this stack to (16 * 1024 * 1024)
set the layerMode of group "group id 1050" to "scrolling"
end preOpenStack
local sScrolling
local sInitialMouseX, sInitialMouseY
local sInitialHScroll, sInitialVScroll
on mouseDown
## Allow the group to scroll
put true into sScrolling
## Record the initial touch position
put item 1 of the mouseLoc into sInitialMouseX
put item 2 of the mouseLoc into sInitialMouseY
## Record the initial hScroll and vScroll
put the vScroll of me into sInitialVScroll
put the hScroll of me into sInitialHScroll
end mouseDown
on mouseMove mouseX, mouseY
## If the screen is being touched then
if sScrolling then
## Calculate how far the touch has moved since it started
put mouseY - sInitialMouseY into tVChange
# put mouseX- sInitialMouseX into tHChange
## Reset the hScroll and vScroll to follow the touch
lock screen
set the vScroll of me to sInitialVScroll - tVChange
# set the hScroll of me to sInitialHScroll - tHChange
unlock screen
end if
end mouseMove
on mouseRelease
mouseUp
end mouseRelease
on mouseUp
put false into sScrolling
end mouseUp