Advertisement
lavalevel

setX

May 12th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.67 KB | None | 0 0
  1. local ButtonPress_processEffect = function(event)
  2.  
  3. local id = event.target.id
  4. local mytest = event.target.setX
  5. print ("test:" .. mytest)
  6. ActiveEffectX= event.target.setX
  7. ActiveEffectY = event.target.setY
  8. print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
  9. --print ("Super Important. ActiveEffectX:" .. event.setX .. " / " .. event.setY )
  10. print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
  11. placeSelector()
  12. ActiveEffect = event.target.id
  13.     print ("Active Effect:" .. ActiveEffect)
  14.     if ActiveEffect == "None" then
  15.         snapshot.fill.effect = nil
  16.     else
  17.  
  18.     snapshot.fill.effect = "filter.".. ActiveEffect
  19.     print ("well we are here...")
  20.  
  21.         if id == "pixelate" then
  22.         snapshot.fill.effect.numPixels = 8
  23.         print ("modified:".. id)
  24.  
  25.         end
  26.  
  27.         if id == "scatter" then
  28.         snapshot.fill.effect.intensity = 0.3
  29.         print ("modified:".. id)
  30.         end
  31.  
  32.         if id == "crystallize" then
  33.         snapshot.fill.effect.numTiles = 64
  34.         print ("modified:".. id)
  35.         end
  36.  
  37.         if id== "posterize" then
  38.         snapshot.fill.effect.colorsPerChannel = 4
  39.         print ("modified:".. id)
  40.         end
  41.  
  42.     end
  43.  
  44. end
  45.  
  46. local function EffectMenu()
  47.  
  48. --display.setDrawMode( "default" )
  49. print ("Make_Effect menu")
  50.  
  51. ButtonGroup_Effects= display.newGroup()
  52.  
  53. Btn_Selector = display.newRoundedRect( 0, 0, 70, 86, 5 )
  54. Btn_Selector:setFillColor( gray )
  55.  
  56. Btn_Effects_Pixel = widget.newButton
  57. {
  58.     id = "pixelate",
  59.     defaultFile = "images/Btn_Effect_Pixel_Up.png",
  60.     overFile = "images/Btn_Effect_Pixel_Down.png",
  61.     label = "Pixel",
  62.     settings =
  63.     {
  64.         min=2, max=20, startAt=20
  65.     },
  66.     labelColor =
  67.     {
  68.         default = { 1, 1, 1 },
  69.     },
  70.     fontSize = 12,
  71.     emboss = true,
  72.     onRelease  = ButtonPress_processEffect,
  73.     labelYOffset = 40,
  74.     setX = .3,
  75.     setY = .3,
  76.  
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement