Custom Image for 'Circles' Preset

Hi Caleb,

Thanks for the great library. I am still learning how to use it.

I am using the “circles” preset. Is it possible to have custom images (instead of the standard circles) ?

Thanks!

 local s = {} s.sampleVent = CBE.NewVent{ preset = "circles", hasColor = true, parentGroup = g\_bubblesAnimations, emitDelay = 500, perEmit = 1, scale = 1.0, lifeSpan = 1000, color = color, physics = { velocity = 1, minX = 0.1, minY = 0.1, maxX = 0.5, maxY = 0.5, }, } s.sampleVent:start()

To build particles, CBEffects lets the user provide a “build function”. This function does whatever you want inside of it, but must return a display object that should be used as a particle.

Examples:
[lua]
build = function()
return display.newRect(0, 0, math.random(100), 10)
end

build = function()
return display.newImageRect(“particle.png”, 30, 30)
end
[/lua]

So all you need to do is provide a build function for whatever image you want to display.

  • C

thanks caleb.

I am trying to set the location to the display.contentCenterY, but the location seems to vary in portrait and landscape mode. Is there something that I am missing ?

contentY = -display.contentCenterY,

Thanks

To build particles, CBEffects lets the user provide a “build function”. This function does whatever you want inside of it, but must return a display object that should be used as a particle.

Examples:
[lua]
build = function()
return display.newRect(0, 0, math.random(100), 10)
end

build = function()
return display.newImageRect(“particle.png”, 30, 30)
end
[/lua]

So all you need to do is provide a build function for whatever image you want to display.

  • C

thanks caleb.

I am trying to set the location to the display.contentCenterY, but the location seems to vary in portrait and landscape mode. Is there something that I am missing ?

contentY = -display.contentCenterY,

Thanks