HI all,
I’m using the newStepper widget on build 2013.1095.
The event phase of the widget I’ve created is still increment or maxLimit !!
Anyone has some ideas on how to fix or workaround?
What is wrong with this code…perhaps I’m missing something?
Please help!
[lua]
– Not DECREMENTING newStepper widget 2
–
local widget = require “widget”
local function onStepPress( event )
local t = event.target
print("newStepper Phase is: ", event.phase)
t.myLab.text = event.value
end
local function createSteppers(numStep)
local stepGroup = display.newGroup()
local label, stepper
local xShift = 100
local yShift = 200
for i=1,numStep do
label = display.newText( “0”, 0, 0, native.systemFont, 58 )
label:setReferencePoint( display.CenterReferencePoint )
label:setTextColor(250, 0, 0)
label.x = xShift
label.y = yShift
stepGroup:insert(label)
– Create a stepper
stepper = widget.newStepper
{
id = i,
initialValue = 0,
labelSize = 42,
minimumValue = -12,
maximumValue = 12,
onPress = onStepPress,
}
stepper.myLab = label
stepper:setReferencePoint( display.CenterReferencePoint )
stepper.x = label.x
stepper.y = yShift + 45
stepGroup:insert(stepper)
xShift = xShift + 150
end
return stepGroup
end
local group = display.newGroup()
local lotOfSteppers = createSteppers(4)
lotOfSteppers:setReferencePoint( display.CenterReferencePoint )
lotOfSteppers.x = display.contentWidth/2
lotOfSteppers.y = display.contentHeight/2
group:insert(lotOfSteppers)
–END
[/lua]
Any suggestion are appreciated
Thanks in advance
Ale