2 questions about graphics 2.0

hi,

i have 2 questions

i looked on the effects page and really read allot on the matter but i have 2 questions,

is it possible for me to do an Outer Glow on a text \ picture ? 

(i tried doing imageName.fill.effect = "“composite.glow” but it doesn’t really do a glow just a wierd fill effect… same on text on text it doesn’t do anything…)

is it possible to do a transition from a blurry image\text to a normal image\text … ?

thnx for all who answer !! :slight_smile:

#1. I don’t think that’s possible, but I could be wrong.

#2. Yes, you could do that by adjusting the values of the filter over time.

Cheers.

Hi @Mars Interactive,

I haven’t built an actual code bit for an “outer glow”, but you may be able to accomplish that by applying a gaussian blur to an underlying clone of the image/text (the underlying object may be filled with the color that you want to be the glow color). Just note that for text (and maybe for an image too), you’ll need to create a snapshot for the underlying glow part, so its blur can extend outside its drawn bounds.

Something like this:

[lua]

local snapshot = display.newSnapshot( 400, 200 )

snapshot.x = display.contentCenterX

snapshot.y = display.contentCenterY-200

local txt = display.newText( “Hello!”, 0, 0, native.systemFont, 50 )

txt:setFillColor( 1, 1, 1 )

snapshot.group:insert( txt )

snapshot.fill.effect = “filter.blurGaussian”

snapshot.fill.effect.horizontal.blurSize = 8

snapshot.fill.effect.horizontal.sigma = 140

snapshot.fill.effect.vertical.blurSize = 8

snapshot.fill.effect.vertical.sigma = 140

local txt2 = display.newText( “Hello!”, display.contentCenterX, display.contentCenterY-200, native.systemFont, 50 )

txt2:setFillColor( 1, 0, 0 )

[/lua]

For a more intense effect, you might also consider a multi-pass shader to increase the intensity or something, but experiment with this first and see what you can achieve.

I’m in the midst of updating the entire Effects documentation/guide with visual examples, so you’ll be able to see more clearly what each effect actually does, along with a basic code sample. It should be done in the next few days or by early next week.

Brent

#1. I don’t think that’s possible, but I could be wrong.

#2. Yes, you could do that by adjusting the values of the filter over time.

Cheers.

Hi @Mars Interactive,

I haven’t built an actual code bit for an “outer glow”, but you may be able to accomplish that by applying a gaussian blur to an underlying clone of the image/text (the underlying object may be filled with the color that you want to be the glow color). Just note that for text (and maybe for an image too), you’ll need to create a snapshot for the underlying glow part, so its blur can extend outside its drawn bounds.

Something like this:

[lua]

local snapshot = display.newSnapshot( 400, 200 )

snapshot.x = display.contentCenterX

snapshot.y = display.contentCenterY-200

local txt = display.newText( “Hello!”, 0, 0, native.systemFont, 50 )

txt:setFillColor( 1, 1, 1 )

snapshot.group:insert( txt )

snapshot.fill.effect = “filter.blurGaussian”

snapshot.fill.effect.horizontal.blurSize = 8

snapshot.fill.effect.horizontal.sigma = 140

snapshot.fill.effect.vertical.blurSize = 8

snapshot.fill.effect.vertical.sigma = 140

local txt2 = display.newText( “Hello!”, display.contentCenterX, display.contentCenterY-200, native.systemFont, 50 )

txt2:setFillColor( 1, 0, 0 )

[/lua]

For a more intense effect, you might also consider a multi-pass shader to increase the intensity or something, but experiment with this first and see what you can achieve.

I’m in the midst of updating the entire Effects documentation/guide with visual examples, so you’ll be able to see more clearly what each effect actually does, along with a basic code sample. It should be done in the next few days or by early next week.

Brent