Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Shape.TEXTURE fill not tiling — Gideros Forum

Shape.TEXTURE fill not tiling

larflarf Member
edited October 2012 in Bugs and issues
Hi Everyone,

This is my first post here so I hope I'm not breaking any rules.

I'm trying to create a polygon shape and fill it with a texture.
Just for a simple test case my shape is square 512x512 and my texture is 256x256
Reading "The Ultimate Guide to Gideros Studio" I was under the impression that if a texture was smaller than the given shape that the texture would be tiled to fill in the extra space.
The texture is showing up in the top left corner no problem but the rest of the square is filled with just the edge colors of the texture. I'll attach a picture.

Here's my code:

local dirtTex = Texture.new("dirt.png")
local block = Shape.new()
block:setFillStyle(Shape.TEXTURE, dirtTex)
block:beginPath(Shape.NON_ZERO)
block:lineTo(512, 0)
block:lineTo(512, 512)
block:lineTo(0, 512)
block:lineTo(0, 0)
block:closePath()
block:endPath()
stage:addChild(block)

Is this a bug? or am I doing something wrong?


Comments

Sign In or Register to comment.