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 / Question about UV

Author
Message
Diegs
8
Years of Service
User Offline
Joined: 27th Oct 2015
Location:
Posted: 3rd Feb 2016 10:37
I don't understand how to scroll a sprite with command :
- SetSpriteUVOffset
- SetSpriteUV

I have an image with size 800px width and 400 px height and I want the image scroll looped in the direction U.

It's possible?

Some help????
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 3rd Feb 2016 10:47
Yes, you need to first set the image to wrap the UVs (using SETIMAGEWRAPU and SETIMAGEWRAPV commands), then you can scroll the image with SETSPRITEUVOFFSET.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Diegs
8
Years of Service
User Offline
Joined: 27th Oct 2015
Location:
Posted: 3rd Feb 2016 12:04
Quote: "Yes, you need to first set the image to wrap the UVs (using SETIMAGEWRAPU and SETIMAGEWRAPV commands), then you can scroll the image with SETSPRITEUVOFFSET."


Meanwhile, thanks for the reply

I understand that I have to use these commands, but I dont know how.....

Would you mind to give me a small example?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 3rd Feb 2016 12:41 Edited at: 3rd Feb 2016 12:48
Sorry Diegs! Sure thing! Here's a quick example:



You'll need to supply your own myimage.png in the media folder. Hope this helps!

p.s. there are examples for SetImageU and V in the help too.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Diegs
8
Years of Service
User Offline
Joined: 27th Oct 2015
Location:
Posted: 3rd Feb 2016 12:54
Oh thanks man ... Great ....

With sprite work fine, but if i use clone sprite don't work .... It's normal????
Diegs
8
Years of Service
User Offline
Joined: 27th Oct 2015
Location:
Posted: 3rd Feb 2016 13:02
I solved with clone...

Thanks BRO ... You are GREAT
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Feb 2016 08:05 Edited at: 4th Feb 2016 08:11
Here's another example, animated progress bar.
https://forum.thegamecreators.com/thread/216108

And if you need help to remember which point is which in the UV data (as I often do), I have a simple image in my tutorial I reference often to remind myself.
http://www.zimnox.com/resources/articles/tutorials/?ar=t004

If you really want to get fancy with UV data:
Local sprite clipping
animated grass

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Feb 2016 09:56
That grass still looks awesome
Diegs
8
Years of Service
User Offline
Joined: 27th Oct 2015
Location:
Posted: 4th Feb 2016 10:14
Thanks Phaelax and great Blog!

Login to post a reply

Server time is: 2024-04-25 08:24:45
Your offset time is: 2024-04-25 08:24:45