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]
