Filters on masked rect

Can I apply a filter on a masked rect? This is my test code:

display.setStatusBar( display.HiddenStatusBar ) local \_W,\_H = display.contentWidth, display.contentHeight; local \_CX,\_CY = display.contentCenterX, display.contentCenterY; local objectGradient = { type="gradient", color1={0,0.75,0.25}, color2={1,0.5,1}, direction="right" }; local objectMask = graphics.newMask( "circlemask.png" ); local object = display.newRect(0,0,200,200); object.fill = objectGradient; object.anchorX = 0.5; object.anchorY = 0.5; object.x = \_CX; object.y = \_CY; object:setMask( objectMask ); object.fill.effect = "filter.blurGaussian"; object.fill.effect.horizontal.radius = 3; object.fill.effect.vertical.radius = 3;

Looks like the mask is ignored. Is it correct?

Can you send me a screenshot?

I’m seeing that it works fine in the latest daily build (2013.2000). Attached are shots (1) with filter off and (2) with filter on.

Ok, I’ve build and loaded on device this code:

display.setStatusBar( display.HiddenStatusBar ) display.setDrawMode( "forceUpdate" ) local \_W,\_H = display.contentWidth, display.contentHeight; local \_CX,\_CY = display.contentCenterX, display.contentCenterY; local objectGradient = { type="gradient", color1={0,0.75,0.25}, color2={1,0.5,1}, direction="right" }; local objectMask = graphics.newMask( "circlemask.png" ); local object = display.newRect(0,0,200,200); object.fill = objectGradient; object.anchorX = 0.5; object.anchorY = 0.5; object.x = \_CX; object.y = \_CY; object:setMask( objectMask ); object.fill.effect = "filter.blurGaussian"; object.fill.effect.horizontal.radius = 3; object.fill.effect.vertical.radius = 3; local function updateFX(event) local value = math.abs( math.sin(event.time\*0.01) ); object.fill.effect.horizontal.radius = 3 - value; object.fill.effect.vertical.radius = 3 + value; end Runtime:addEventListener("enterFrame", updateFX);

Now i can see the difference on my iPhone 4S but i can’t see the “processed” object on the simulator, maybe because of the computer hardware? Can you see the circle on the simulator using this configuration?

build.settings

settings = { orientation = { default = "landscape", supported = { "landscapeLeft", "landscapeRight" } }, iphone = { plist = { UIApplicationExitsOnSuspend=true, UIHiddenStatusBar= true, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-72.png", "Icon-72@2x.png", }, }, }, }

config.lua

application = { content = { width = 320, height = 480, scale = "letterbox" }, }

Can you provide details on the computer you are running the simulator on?

Specifically:

Mac/Win

OS version

Model of computer

Graphics Card

Running as a VM?

Macbook 2.4Ghz Intel Core 2 Duo

Mac OS X 10.7.5

RAM: 4GB 667 MHz DDR2 SDRAM

Graphics Card: Intel GMA X3100 graphics

This is it -> http://www.everymac.com/systems/apple/macbook/specs/macbook-core-2-duo-2.4-white-13-early-2008-penryn-specs.html

Yes, indie inside! :slight_smile:

Anyway i can see the FiltersDemo without any problems on the simulator, that’s why i thought about an SDK issue.

Can you send me a screenshot?

I’m seeing that it works fine in the latest daily build (2013.2000). Attached are shots (1) with filter off and (2) with filter on.

Ok, I’ve build and loaded on device this code:

display.setStatusBar( display.HiddenStatusBar ) display.setDrawMode( "forceUpdate" ) local \_W,\_H = display.contentWidth, display.contentHeight; local \_CX,\_CY = display.contentCenterX, display.contentCenterY; local objectGradient = { type="gradient", color1={0,0.75,0.25}, color2={1,0.5,1}, direction="right" }; local objectMask = graphics.newMask( "circlemask.png" ); local object = display.newRect(0,0,200,200); object.fill = objectGradient; object.anchorX = 0.5; object.anchorY = 0.5; object.x = \_CX; object.y = \_CY; object:setMask( objectMask ); object.fill.effect = "filter.blurGaussian"; object.fill.effect.horizontal.radius = 3; object.fill.effect.vertical.radius = 3; local function updateFX(event) local value = math.abs( math.sin(event.time\*0.01) ); object.fill.effect.horizontal.radius = 3 - value; object.fill.effect.vertical.radius = 3 + value; end Runtime:addEventListener("enterFrame", updateFX);

Now i can see the difference on my iPhone 4S but i can’t see the “processed” object on the simulator, maybe because of the computer hardware? Can you see the circle on the simulator using this configuration?

build.settings

settings = { orientation = { default = "landscape", supported = { "landscapeLeft", "landscapeRight" } }, iphone = { plist = { UIApplicationExitsOnSuspend=true, UIHiddenStatusBar= true, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-72.png", "Icon-72@2x.png", }, }, }, }

config.lua

application = { content = { width = 320, height = 480, scale = "letterbox" }, }

Can you provide details on the computer you are running the simulator on?

Specifically:

Mac/Win

OS version

Model of computer

Graphics Card

Running as a VM?

Macbook 2.4Ghz Intel Core 2 Duo

Mac OS X 10.7.5

RAM: 4GB 667 MHz DDR2 SDRAM

Graphics Card: Intel GMA X3100 graphics

This is it -> http://www.everymac.com/systems/apple/macbook/specs/macbook-core-2-duo-2.4-white-13-early-2008-penryn-specs.html

Yes, indie inside! :slight_smile:

Anyway i can see the FiltersDemo without any problems on the simulator, that’s why i thought about an SDK issue.