Widget 2.0: Newslider Not Using Imagesheet Specifications

Ok, I’m looking at the code but I’m not quite understanding the code and what it’s doing.  I’m trying to customize a horizontal slider and this is what I see:

local function createHorizontalSlider( slider, options )

    – Create a local reference to our options table

    local opt = options

        

    – Forward references

    local imageSheet, view, viewLeft, viewRight, viewMiddle, viewFill, viewHandle

        

    – Create the view

    if opt.sheet then

        imageSheet = opt.sheet

    else

        local themeData = require( opt.themeData )

        imageSheet = graphics.newImageSheet( opt.themeSheetFile, themeData:getSheet() )

    end

    

    – The view is the slider (group)

    view = slider

    

    – The slider’s left frame

    viewLeft = display.newImageRect( slider, imageSheet, opt.leftFrame, opt.frameWidth, opt.frameHeight )

    

    – The slider’s middle frame

    viewMiddle = display.newImageRect( slider, imageSheet, opt.middleFrame, opt.frameWidth, opt.frameHeight )

    

    – The slider’s right frame

    viewRight = display.newImageRect( slider, imageSheet, opt.rightFrame, opt.frameWidth, opt.frameHeight )

    

    – The slider’s fill

    viewFill = display.newImageRect( slider, imageSheet, opt.fillFrame, opt.frameWidth, opt.frameHeight )

    

    – The slider’s handle

    viewHandle = display.newImageRect( slider, imageSheet, opt.handleFrame, opt.handleWidth, opt.handleHeight )

It’s not stating a specific imageSheet that its using. 

I’m also having troubles customising the sliders. It would be great if the example code in the docs provided an example sheet along with the parameters for skinning the slider. This actually goes for the other widgets too, we really need to have a template sheet to work from. At least then we would have a rough idea for how it works?

Thanks, N

Actually it is saying what sheet to use:

   -- Create the view     if opt.sheet then         imageSheet = opt.sheet     else         local themeData = require( opt.themeData )         imageSheet = graphics.newImageSheet( opt.themeSheetFile, themeData:getSheet() )     end

I’m also having troubles customising the sliders. It would be great if the example code in the docs provided an example sheet along with the parameters for skinning the slider. This actually goes for the other widgets too, we really need to have a template sheet to work from. At least then we would have a rough idea for how it works?

Thanks, N

Actually it is saying what sheet to use:

   -- Create the view     if opt.sheet then         imageSheet = opt.sheet     else         local themeData = require( opt.themeData )         imageSheet = graphics.newImageSheet( opt.themeSheetFile, themeData:getSheet() )     end