Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Is it possible to create a sprite as background and set UV to scroll horizontal smoothly?

Author
Message
2D Analyst
AGK Developer
19
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 27th Sep 2019 00:49 Edited at: 27th Sep 2019 00:57
I'm trying to setup a game, where the background scroll horizontally.

For example:

The screen size is 640x1136 and the image size is 1280x1136. I want this image to scroll toward the end and start from the beginning of image again.

I basically want the bg sprite to automatically reset back to the begin when it reaches the end.

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Sep 2019 00:59 Edited at: 27th Sep 2019 01:07
Yes. Did that with this boulderdash clone.

It's just a hunch but i reckon when your offset gets to 1 then reset it to zero




Scrolling UVs;


You also need to set UV Wrap for your sprite's image;
2D Analyst
AGK Developer
19
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 27th Sep 2019 01:08
Amazing dude!! Fastest response ever on any forum! Appreciate it!

SetImageWrapU(game.ground_img, 1)

I should have read the help guide =)


I stopped using AppGameKit earlier this year and now I'm back into it.

Login to post a reply

Server time is: 2024-04-23 21:20:41
Your offset time is: 2024-04-23 21:20:41