Feature request > 2D

POLYVECTOR UVs

(1/2) > >>

bigsofty:
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

Kitty Hello:
well, just use GETSPRITESIZE and multiply with this value.
Wrapping is possible.

bigsofty:
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

spicypixel:

--- 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

--- End quote ---

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?

Moebius:
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:

--- Code: (glbasic) ---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
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version