Skip to content

Instantly share code, notes, and snippets.

@0xGGGGG
Created January 7, 2012 20:01
Show Gist options
  • Save 0xGGGGG/1575844 to your computer and use it in GitHub Desktop.
Save 0xGGGGG/1575844 to your computer and use it in GitHub Desktop.
Corona SDK - Neon Effect in Text or Shape - First Way
--a not effective way to make a neon text in corona sdk, the trick is make a loop and down the alpha
--you can use it to make shapes in neon too ;)
--email me: [email protected] ;)
---Circle Example
--i = 0
--while i < neonSize do
-- t = display.newCircle(x,y,circleSize + i) --create the circle
-- t:setFillColor(colorR,colorG,colorB) --set the color of the text
-- t.alpha = 1/i * 1 --change alpha
-- i = i + 1 --continue the loop
--end
---
display.setStatusBar(display.HiddenStatusBar) --hide status bar
--define values
background = display.newImage("background.png",0,0) --create background image
string = "corona" --define the text
x = 100 --the text x
y = 100 --the text y
textFont = "Helvetica"
fontSize = 60 --the font size
colorR = 0 --the R value of the text
colorG = 255 --the G value of the text
colorB = 255 --the B value of the text
neonSize = 5 --change the neon range
--make the loop
i = 0
while i < neonSize do
t = display.newText(string,x + i,y - i,textFont,fontSize) --create text
t:setTextColor(colorR,colorG,colorB) --set the color of the text
t.alpha = 1/i * 1 --change alpha
i = i + 1 --continue the loop
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment