View Single Post
10-18-15, 05:39 AM   #7
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
When you set tiling to false (the second argument of SetTexture), it repeats the edge pixel when you set texture coordinates outside the bounds of the image itself. If tiling is set to true then it starts drawing the texture again, neither of which is what you want.

Since you're using your own image here, the simplest solution is to put a transparent border around it so the part that's repeated isn't visible.

If you weren't able to modify the image, you could set the height and width of the texture instead of setting your coordinates outside the boundaries.

In other words, if you have 100px on the side of your texture that are being repeated, you need to dynamically set the width of the texture to be 100px shorter in addition to adjusting your coordinates to avoid drawing outside the lines.

On a related note, instead of screwing with the texture coordinates just to drag an image around, you could just use standard frame dragging techniques and slap it in a scroll frame to clip it.
  Reply With Quote