Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ButtonPress_processEffect = function(event)
- local id = event.target.id
- local mytest = event.target.setX
- print ("test:" .. mytest)
- ActiveEffectX= event.target.setX
- ActiveEffectY = event.target.setY
- print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
- --print ("Super Important. ActiveEffectX:" .. event.setX .. " / " .. event.setY )
- print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
- placeSelector()
- ActiveEffect = event.target.id
- print ("Active Effect:" .. ActiveEffect)
- if ActiveEffect == "None" then
- snapshot.fill.effect = nil
- else
- snapshot.fill.effect = "filter.".. ActiveEffect
- print ("well we are here...")
- if id == "pixelate" then
- snapshot.fill.effect.numPixels = 8
- print ("modified:".. id)
- end
- if id == "scatter" then
- snapshot.fill.effect.intensity = 0.3
- print ("modified:".. id)
- end
- if id == "crystallize" then
- snapshot.fill.effect.numTiles = 64
- print ("modified:".. id)
- end
- if id== "posterize" then
- snapshot.fill.effect.colorsPerChannel = 4
- print ("modified:".. id)
- end
- end
- end
- local function EffectMenu()
- --display.setDrawMode( "default" )
- print ("Make_Effect menu")
- ButtonGroup_Effects= display.newGroup()
- Btn_Selector = display.newRoundedRect( 0, 0, 70, 86, 5 )
- Btn_Selector:setFillColor( gray )
- Btn_Effects_Pixel = widget.newButton
- {
- id = "pixelate",
- defaultFile = "images/Btn_Effect_Pixel_Up.png",
- overFile = "images/Btn_Effect_Pixel_Down.png",
- label = "Pixel",
- settings =
- {
- min=2, max=20, startAt=20
- },
- labelColor =
- {
- default = { 1, 1, 1 },
- },
- fontSize = 12,
- emboss = true,
- onRelease = ButtonPress_processEffect,
- labelYOffset = 40,
- setX = .3,
- setY = .3,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement