Create a new POLYVECTOR command/flag that uses proper UV texture (0..1) coordinates, instead of pixel based ones. This would allow for higher res graphics to be used without needing to change code. Scaling between resolutions/platforms would be easier as the UVs would not need to be changed. Also would allow for texture wrapping (UVs > 1).
Obviously not ideal for all occasions but it would add more flexibility to the current command. Maybe an optional flag/new command?
Cheers,
Ian
well, just use GETSPRITESIZE and multiply with this value.
Wrapping is possible.
Cool, that's a nice tip Gernot, I never realised that if you put a texture coord outside the the texture range in POLYVECTOR it wraps! :D
Cheers,
Ian
Quote from: bigsofty on 2011-Apr-07
Create a new POLYVECTOR command/flag that uses proper UV texture (0..1) coordinates, instead of pixel based ones. This would allow for higher res graphics to be used without needing to change code. Scaling between resolutions/platforms would be easier as the UVs would not need to be changed. Also would allow for texture wrapping (UVs > 1).
Obviously not ideal for all occasions but it would add more flexibility to the current command. Maybe an optional flag/new command?
Cheers,
Ian
I actually messed about with PolyVectors before and achieved the tiling effect when I was trying to scale an image up. Now I actually want the tiling effect but cannot work out the PV commands to do it lol :) Anyone?
For tiling, just set the texture coordinates to be greater than the size of the image. (If I remember correctly, this only works 'properly' with power of 2 image sizes, otherwise you get borders in between tiles.) You can even have negative texture coordinates.
e.g. to tile an image across the screen :good:
CONSTANT Width = 800, Height = 600
STARTPOLY 123, 2
POLYVECTOR 0, 0, 0, 0
POLYVECTOR Width, 0, Width, 0
POLYVECTOR 0, Height, 0, Height
POLYVECTOR Width, Height, Width, Height
ENDPOLY
Thank you very much :good:
Any confirmation of what platforms it does work on. I'm really only interested in iOS and Android but can test those myself. But cheers for the heads up Ocean ;)
iOS, Android, Windows and Mac (AFAIK) work - haven't tried WinCE...
Works for all.