scroll uvs

BlitzMax Forums/BlitzMax Programming/scroll uvs

Robert Cummings(Posted 2006) [#1]
Is there a way to scroll the textures that are drawn with DrawImage, perhaps before drawing, similar to SetScale..?


ImaginaryHuman(Posted 2006) [#2]
Draw it with SetScale then use GrabImage.

Did you mean scroll or scale?

To scroll you'd have to draw it in four parts then grab it back, or have a clever polygon texture coord thing.


Robert Cummings(Posted 2006) [#3]
or have a clever polygon texture coord thing
Sort of what I was asking for in the topic.


Dreamora(Posted 2006) [#4]
You can access the UV to do this, there is a function in DX and OpenGL to set the UV.

there is no scrolling command or similar because Max2D does not even intend to allow you drawing parts of the image, which is in the end very similar to scrolling (both UV modification)


ImaginaryHuman(Posted 2006) [#5]
If you create your own quad and define the texture coordinate at each vertex you create, you can have it point to any part of the texture, which would let you scroll over it. You'd have to enable wrapping in both directions to allow it to wrap around automatically. You could probably do the whole thing in a single quad.