Quote: "But what is the correct value to wrap at (taking into account texture scaling)?"
Something like this perhaps?
set display mode desktop width(), desktop height(), 32, 1
sync on : sync rate 60 : sync
cls rgb(255,0,0)
box 32, 32, 96, 96, rgb(0,255,0), rgb(0,255,0), rgb(0,255,0), rgb(0,255,0)
get image 1, 0, 0, 128, 128
make object plain 1, 200, 200
texture object 1, 1
scale object texture 1, 5.7, 1
totalUScroll# = 0.0
scrollIncrement# = 0.01
repeat
if totalUScroll# < 1.0
scroll object texture 1, scrollIncrement#, 0.0 : inc totalUScroll#, scrollIncrement#
else
scroll object texture 1, -1.0+scrollIncrement#, 0.0 : dec totalUScroll#, 1.0 - scrollIncrement#
endif
text 20, 20, str$(totalUScroll#,3)
sync
until spacekey()
end
Why do you want to take account of texture scaling?
Edit Fixed minor bug in sample code - the "else" part needs to wrap and increment the scroll.
Edit2 And fixed another one
. Hopefully I've got it right this time.