Skip to content

Instantly share code, notes, and snippets.

@chrisdugne
Created April 5, 2019 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdugne/73962c558743f613d5232b8128d3e0a2 to your computer and use it in GitHub Desktop.
Save chrisdugne/73962c558743f613d5232b8128d3e0a2 to your computer and use it in GitHub Desktop.
local cardW = W * 0.9
local cardH = 250
local SR = 3 -- shadow radius
local SA = 0.4 -- shadow alpha
local card = display.newGroup()
options.parent:insert(card)
card.x = options.x
card.y = options.y
-----------------------------
local shadeGroup = display.newSnapshot(card, cardW + SR * 2, cardH + SR * 2)
shadeGroup.x, shadeGroup.y = SR * 1.2, SR * 1.2
shadeGroup.fill.effect = 'filter.blurGaussian'
shadeGroup.fill.effect.horizontal.blurSize = SR
shadeGroup.fill.effect.vertical.blurSize = SR
local shadow =
display.newRoundedRect(shadeGroup.group, 0, 0, cardW + SR, cardH + SR, 7)
shadow:setFillColor(0, 0, 0, SA)
local panel = display.newRoundedRect(card, 0, 0, cardW, cardH, 7)
panel:setFillColor(1, 1, 1, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment