Blur effect problems

Ah. How would I go about blurring the edges of a circle?

One way is to put it in a snapshot and apply the blur on the snapshot — you just have to make the snapshot large enough, and center the circle inside the snapshot.

What if I applied it to a display group which has two circles inside it, one large white circle and one smaller, lets say, red circle. Would that blur the edge of the red circle, effectively? Sorry, on a train and can’t test it right now. I’m trying to get as much if the graphics in my game to be programmatically rendered with image files (being inspired by the Designed by Apple video.)

Also, is blur the only filter with no opens? Either on or off, no degrees of effect, etc?

There’s a blurGaussian effect, but there’s a bug in it in DP 2/Alpha 2.

In the next update, the syntax will look like:

object.fill.effect = “filter.blurGaussian”

object.fill.effect.horizontal.radius = 2

object.fill.effect.vertical.radius = 2

The gaussian blur operates in a multipass fashion (a horizontal and vertical pass) so you have to set the radius for each path, or you could set them to different values.

I’ve tried this:

local group = display.newGroup() local back = display.newCircle( 350, 350, 200 ) local image1 = display.newCircle( 350, 350, 150 ) image1:setFillColor(255,0,0) group.fill.effect = "filter.blue"

Which produced this error:

attempt to index field 'fill' (a nil value) 

on the last line.

Also, am I the only one who finds it strange to set a string and then set table values against it?

aaaaaand… one last request:

How would I replicate the iOS7 Control Center effect, also seen in Yahoo’s latest Weather app?

I thought the filters could be applied to display groups.

Filter effects cannot be applied to groups. You can, however, apply them to snapshots

I’m trying this syntax and no matter the value there is an extreme amount of blur and no change if I changen the radius.

[lua]local object = display.newImageRect(“test.jpg”, _W, _H)

object.fill.effect = “filter.blurGaussian”

local amount = 10

object.fill.effect.horizontal.radius = amount

object.fill.effect.vertical.radius = amount

[/lua]

Looks like this, no matter the amount specified:  UrI7nk8.png

Photoshop same image with 10 radius: 70tK0yC.png

Same problem with 

[lua]object.fill.effect = “filter.blurHorizontal”

local amount = 1

object.fill.effect.radius = amount[/lua]

Same horizontal blur no matter what amount.

Edit: Daily build 103

When you blur a solid color, you see no blur except on the edges. Haven’t tried filters much but I guess the effect can not go over the edge?

Yes, the blur only extends as far as the bounds of the rect (or polygon, as the case may be).

Ah. How would I go about blurring the edges of a circle?

One way is to put it in a snapshot and apply the blur on the snapshot — you just have to make the snapshot large enough, and center the circle inside the snapshot.

What if I applied it to a display group which has two circles inside it, one large white circle and one smaller, lets say, red circle. Would that blur the edge of the red circle, effectively? Sorry, on a train and can’t test it right now. I’m trying to get as much if the graphics in my game to be programmatically rendered with image files (being inspired by the Designed by Apple video.)

Also, is blur the only filter with no opens? Either on or off, no degrees of effect, etc?

There’s a blurGaussian effect, but there’s a bug in it in DP 2/Alpha 2.

In the next update, the syntax will look like:

object.fill.effect = “filter.blurGaussian”

object.fill.effect.horizontal.radius = 2

object.fill.effect.vertical.radius = 2

The gaussian blur operates in a multipass fashion (a horizontal and vertical pass) so you have to set the radius for each path, or you could set them to different values.

I’ve tried this:

local group = display.newGroup() local back = display.newCircle( 350, 350, 200 ) local image1 = display.newCircle( 350, 350, 150 ) image1:setFillColor(255,0,0) group.fill.effect = "filter.blue"

Which produced this error:

attempt to index field 'fill' (a nil value) 

on the last line.

Also, am I the only one who finds it strange to set a string and then set table values against it?

aaaaaand… one last request:

How would I replicate the iOS7 Control Center effect, also seen in Yahoo’s latest Weather app?

I thought the filters could be applied to display groups.

Filter effects cannot be applied to groups. You can, however, apply them to snapshots

I’m trying this syntax and no matter the value there is an extreme amount of blur and no change if I changen the radius.

[lua]local object = display.newImageRect(“test.jpg”, _W, _H)

object.fill.effect = “filter.blurGaussian”

local amount = 10

object.fill.effect.horizontal.radius = amount

object.fill.effect.vertical.radius = amount

[/lua]

Looks like this, no matter the amount specified:  UrI7nk8.png

Photoshop same image with 10 radius: 70tK0yC.png

Same problem with 

[lua]object.fill.effect = “filter.blurHorizontal”

local amount = 1

object.fill.effect.radius = amount[/lua]

Same horizontal blur no matter what amount.

Edit: Daily build 103