enhanced slider

Having trouble creating my own slides by removing loop
for i=1, 4 do

I like the i= code because it allows me to use tables. But not sure about individualizing each element.Would I use

– slide background (image or just a simple rect in this example)
local myimage = display.newImage( “myimage.png”, true )
thisSlideGroup:insert( Image )
– add more elements to slide

[code]

local thisSlideGroup

–create 4 sample slides using a loop:
for i=1,4 do

thisSlideGroup = display.newGroup() --IMPORTANT!!! Create a new display group for each slide!
–localGroup:insert(thisSlideGroup) --ACTIVATE THIS LINE IF USING DIRECTOR

– slide background (image or just a simple rect in this example)
local rect = display.newRect( -ox, -oy, cw+ox+ox, ch+oy+oy-110 )
thisSlideGroup:insert( rect )
rect:setFillColor( i*55, 255-i*55, 220 )
– add more elements to slide
local txt = display.newText( " SLIDE "…i, 0, 0, native.systemFontBold, 48 )
thisSlideGroup:insert( txt )
txt:setTextColor( 255, 255, 255 )
txt:setReferencePoint(display.CenterLeftReferencePoint) ; txt.x = 0 ; txt.y = 128

sliderGroup:insert( thisSlideGroup )
thisSlideGroup.x = ((sliderGroup.numChildren-1)*slideDist)
end

maxSlideIndex = sliderGroup.numChildren-1
[/code] [import]uid: 88495 topic_id: 30749 reply_id: 330749[/import]

Hi Stephen,

I think most people who use the module create individual slide groups and customize them manually. You can still use loops for some things, for example, if you have a slide with 4 rows and 4 columns of level “tile buttons” which the player can unlock and select (like Angry Birds and countless other games), you can create those in a loop… just ensure that all of those loop elements are added to the slide group. :slight_smile:

Brent Sorrentino [import]uid: 9747 topic_id: 30749 reply_id: 123166[/import]

Hi Stephen,

I think most people who use the module create individual slide groups and customize them manually. You can still use loops for some things, for example, if you have a slide with 4 rows and 4 columns of level “tile buttons” which the player can unlock and select (like Angry Birds and countless other games), you can create those in a loop… just ensure that all of those loop elements are added to the slide group. :slight_smile:

Brent Sorrentino [import]uid: 9747 topic_id: 30749 reply_id: 123166[/import]