Image Fills and 2.5d Bug?

Hey everyone,

I was playing around with some of the new features in Graphics 2.0 and I might have found a bug.

I made a rectangle, and applied an image fill.  I set the display.defaults to wrap, and set up a transition for the fill offset.

So far, so good - the image scrolled through the rectangle.

However, as soon as I applied a 2.5d deformation to the verts of the rectangle, the offset no longer worked, and I lost the scrolling effect.

Is this a known bug or limitation, or should I file something?

Cheers,

Dan

Well, I was thinking about this issue, (and i’m no expert) but it occured to me that perhaps the 2.5d transformation is somehow ONLY calculated after the fill is rendered.  And if, for some reason, Corona has a 2.5 d object, it won’t update the fill.

So I made a test, and in an “enterFrame” event, manually set the corner points back to 0,0, then offset the fill, then readjust the corner points.

VOIALA - it works, 2.5d scrolling textures.

However, this doesn’t seem like a very good workflow, and I’m still prototyping, but I’m guessing this method has an impact on performance.  Could one of you fine people over at Ansca take a look at this please?

Hi Dan,

This is probably a limitation, not a bug. I’ve worked plenty with the offsetting and repeat stuff, but I never tried to use a 2.5D transform on the object. If you can post your code, I’ll experiment a bit with it.

Thanks,

Brent

display.setDefault( "textureWrapX", "repeat" ) display.setDefault( "textureWrapY", "repeat" ) local scrollSpeed = .01 local ground = {} --Create ground["flat"] = display.newRect(0,0,200, 200) ground["notWorking"] = display.newRect(0,0,200, 200) ground["workaround"] = display.newRect(0,0,200, 200) --Position ground["notWorking"].x, ground["notWorking"].y = display.contentWidth/5, display.contentHeight/2 ground["flat"].x, ground["flat"].y = display.contentWidth/2, display.contentHeight/2 ground["workaround"].x, ground["workaround"].y = display.contentWidth\*4/5, display.contentHeight/2 --Paint local groundPaint = { type="image", filename="groundTest.png" } ground["flat"].fill = groundPaint ground["notWorking"].fill = groundPaint ground["workaround"].fill = groundPaint --2.5D ground["notWorking"].path.x1, ground["notWorking"].path.y1 = 50, 25 ground["notWorking"].path.x2, ground["notWorking"].path.y2 = -50, 0 ground["notWorking"].path.x3, ground["notWorking"].path.y3 = 50, 0 ground["notWorking"].path.x4, ground["notWorking"].path.y4 = -50, 25 ground["workaround"].path.x1, ground["workaround"].path.y1 = 50, 25 ground["workaround"].path.x2, ground["workaround"].path.y2 = -50, 0 ground["workaround"].path.x3, ground["workaround"].path.y3 = 50, 0 ground["workaround"].path.x4, ground["workaround"].path.y4 = -50, 25 local update = function() --Unset 2.5d ground["workaround"].path.x1, ground["workaround"].path.y1 = 0, 0 ground["workaround"].path.x2, ground["workaround"].path.y2 = 0, 0 ground["workaround"].path.x3, ground["workaround"].path.y3 = 0, 0 ground["workaround"].path.x4, ground["workaround"].path.y4 = 0, 0 --Scroll Texture ground["flat"].fill.y = ground["flat"].fill.y - scrollSpeed ground["notWorking"].fill.y = ground["notWorking"].fill.y - scrollSpeed ground["workaround"].fill.y = ground["workaround"].fill.y - scrollSpeed --Reset 2.5d ground["workaround"].path.x1, ground["workaround"].path.y1 = 50, 25 ground["workaround"].path.x2, ground["workaround"].path.y2 = -50, 0 ground["workaround"].path.x3, ground["workaround"].path.y3 = 50, 0 ground["workaround"].path.x4, ground["workaround"].path.y4 = -50, 25 end Runtime:addEventListener("enterFrame", update)

groundTest.png

Thanks for the reply Brent, and sorry that took a while to get back to you.

I set up the 3 examples right there - regular working flat version, 2.5d showcasing the problem, and then my work around.

Thanks!

Well, I was thinking about this issue, (and i’m no expert) but it occured to me that perhaps the 2.5d transformation is somehow ONLY calculated after the fill is rendered.  And if, for some reason, Corona has a 2.5 d object, it won’t update the fill.

So I made a test, and in an “enterFrame” event, manually set the corner points back to 0,0, then offset the fill, then readjust the corner points.

VOIALA - it works, 2.5d scrolling textures.

However, this doesn’t seem like a very good workflow, and I’m still prototyping, but I’m guessing this method has an impact on performance.  Could one of you fine people over at Ansca take a look at this please?

Hi Dan,

This is probably a limitation, not a bug. I’ve worked plenty with the offsetting and repeat stuff, but I never tried to use a 2.5D transform on the object. If you can post your code, I’ll experiment a bit with it.

Thanks,

Brent

display.setDefault( "textureWrapX", "repeat" ) display.setDefault( "textureWrapY", "repeat" ) local scrollSpeed = .01 local ground = {} --Create ground["flat"] = display.newRect(0,0,200, 200) ground["notWorking"] = display.newRect(0,0,200, 200) ground["workaround"] = display.newRect(0,0,200, 200) --Position ground["notWorking"].x, ground["notWorking"].y = display.contentWidth/5, display.contentHeight/2 ground["flat"].x, ground["flat"].y = display.contentWidth/2, display.contentHeight/2 ground["workaround"].x, ground["workaround"].y = display.contentWidth\*4/5, display.contentHeight/2 --Paint local groundPaint = { type="image", filename="groundTest.png" } ground["flat"].fill = groundPaint ground["notWorking"].fill = groundPaint ground["workaround"].fill = groundPaint --2.5D ground["notWorking"].path.x1, ground["notWorking"].path.y1 = 50, 25 ground["notWorking"].path.x2, ground["notWorking"].path.y2 = -50, 0 ground["notWorking"].path.x3, ground["notWorking"].path.y3 = 50, 0 ground["notWorking"].path.x4, ground["notWorking"].path.y4 = -50, 25 ground["workaround"].path.x1, ground["workaround"].path.y1 = 50, 25 ground["workaround"].path.x2, ground["workaround"].path.y2 = -50, 0 ground["workaround"].path.x3, ground["workaround"].path.y3 = 50, 0 ground["workaround"].path.x4, ground["workaround"].path.y4 = -50, 25 local update = function() --Unset 2.5d ground["workaround"].path.x1, ground["workaround"].path.y1 = 0, 0 ground["workaround"].path.x2, ground["workaround"].path.y2 = 0, 0 ground["workaround"].path.x3, ground["workaround"].path.y3 = 0, 0 ground["workaround"].path.x4, ground["workaround"].path.y4 = 0, 0 --Scroll Texture ground["flat"].fill.y = ground["flat"].fill.y - scrollSpeed ground["notWorking"].fill.y = ground["notWorking"].fill.y - scrollSpeed ground["workaround"].fill.y = ground["workaround"].fill.y - scrollSpeed --Reset 2.5d ground["workaround"].path.x1, ground["workaround"].path.y1 = 50, 25 ground["workaround"].path.x2, ground["workaround"].path.y2 = -50, 0 ground["workaround"].path.x3, ground["workaround"].path.y3 = 50, 0 ground["workaround"].path.x4, ground["workaround"].path.y4 = -50, 25 end Runtime:addEventListener("enterFrame", update)

groundTest.png

Thanks for the reply Brent, and sorry that took a while to get back to you.

I set up the 3 examples right there - regular working flat version, 2.5d showcasing the problem, and then my work around.

Thanks!