I tried rounding the corners on a photo and had an issue too. The texture is a 140 x 140 png and the path2d rounded rectangle is 140 x 140 too, but I get this strange effect:
I know it isn't a power of 2 image, but no wrapping is required. I tried wrap, no wrap, filtered, unfiltered etc but the result is the same.
So with Path2D you have found that textures don't wrap repeat ?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@totebo, Sorry for the delay replying, I am on holidays (until monday) and didn't find enough time to check your issue with Path2D.
Path2D makes the texture fill the entire shape by default, whatever its size is. There is bug in that textures must be a power of two to fit correctly, and I just fixed it, however this wasn't your case.
If you want to tile your textures multiple times, you need to pass a texture transform matrix as second parameter to setTexture, ex:
local scl=Matrix.new()
scl:setScale(1/5)--Scale down by 5, so that the five textures unit fits in width and height
p:setTexture( texture,scl )
This works for me, can you confirm it does for you too ?
Comments
http://docs.giderosmobile.com/reference/gideros/Path2D/setTexture#Path2D:setTexture
"Sets texture for fill (Not implemented yet)"
(not sure why the standard example comes up when sharing the code: http://giderosmobile.com/code/output/MoLbJdwyd2zjU3SFi433anLEyn7dR1vN)
I tried rounding the corners on a photo and had an issue too. The texture is a 140 x 140 png and the path2d rounded rectangle is 140 x 140 too, but I get this strange effect:
I know it isn't a power of 2 image, but no wrapping is required.
I tried wrap, no wrap, filtered, unfiltered etc but the result is the same.
My issue is different; a 128x128px image used as a texture of a Path2D shape doesn't repeat, but it repeats fine as a texture of a Shape.
https://deluxepixel.com
Sorry for the delay replying, I am on holidays (until monday) and didn't find enough time to check your issue with Path2D.
Path2D makes the texture fill the entire shape by default, whatever its size is. There is bug in that textures must be a power of two to fit correctly, and I just fixed it, however this wasn't your case.
If you want to tile your textures multiple times, you need to pass a texture transform matrix as second parameter to setTexture, ex:
Attached a test project in case anyone is reading this and want to see it in action.
ps. Help much appreciated. I am also on holiday, but trying to squeeze in a little Gideros fun time here and there too.