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 Classic Chat / UV Scrolling for background

Author
Message
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 1st Dec 2012 16:17
I have an image I want to scroll in the background but when the images reaches the edge you can see the split where the image ends and the image begins. Is there a way to fix that through code or should I tell my artist to change the image.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 1st Dec 2012 19:28
Is the image you are using a power of 2 in size?
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 1st Dec 2012 23:08
It was 800 X 500 but I just changed it to 1024 X 512 but still isnt working.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Dec 2012 14:53
try changing the line agk::SetSpriteUVBorder( bgSprite, 0.5); to agk::SetSpriteUVBorder( bgSprite, 0); if this doesn't work can you post a screenshot of what you see
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 4th Dec 2012 02:02
Here is the image.

Attachments

Login to view attachments
Jogimus
11
Years of Service
User Offline
Joined: 10th Nov 2012
Location:
Posted: 4th Dec 2012 07:02
That background image is not "tileable", artist should fix it so left and right edges of the image match each other.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Dec 2012 18:06
The quickest way to make it tileable is:

1: Cut the image vertically in the middle, or any other appropriate point
2: Switch each section to the other side (Right to Left and Left to Right)
3: Manually fix the join you just created in the middle, by blurring, cloning etc.

You now have a horizontally scrollable image. If you want it to scroll up and down, you need to do the same by cutting horizontally.

gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 8th Dec 2012 20:17
That makes sense. Thanks for the help.

Login to post a reply

Server time is: 2024-04-27 18:41:09
Your offset time is: 2024-04-27 18:41:09