How to scroll a tiling texture
richicon
Member, PRO Posts: 55
On my GUI menus, I'd like a tiling texture to continuously scroll in the background - a little like this:
( - between 10 seconds and 20 in the video - the green checks pattern).
I tried a tiling image - which tiles OK (actor size 1024x768, image size 256x256 with X and Y Wrap selected in Graphics).
It tiles OK and fills the screen - but if I try to move it using the Motion settings in the Actor the actor moves rather than the tiling image.
How do I just scroll the tiling texture image?
( - between 10 seconds and 20 in the video - the green checks pattern).
I tried a tiling image - which tiles OK (actor size 1024x768, image size 256x256 with X and Y Wrap selected in Graphics).
It tiles OK and fills the screen - but if I try to move it using the Motion settings in the Actor the actor moves rather than the tiling image.
How do I just scroll the tiling texture image?
Answers
i.e.
if self.position.x < 512
do:
Interpolate self.position.x to: 512
for 6 seconds
else:
set self.position.x to 0
Assuming the GUI is a single scene, and the background image is a sing actor, all you need to do is set the tile width/height to a value that is consistent.
IE tile width/height 256x256 and have scene x/y set to wrap and the actor graphics height/width set to tile, then all you need to do is set the actors linear motion x or y to a value.
I use it for scrolling starfields and parallax style backgrounds frequently.