Hi,
I have several scenes on my project. 3 of those scenes will be populated with around 10 objects and only one of those objects will differ when moving from scene to scene.
I’m trying to move that repetitive code in an external module:
[lua]-- subtab.lua
module(…, package.seeall)
function addtab()
local subtab = display.newImageRect( “assets/bgsubtabbar.png”, 320, 44 )
local shadow = display.newImage( “assets/shadow.png” )
local bgbtlist = display.newImageRect( “assets/bgfilteron.png”, 98, 30 )
local lblbtlist = display.newText( “List”, 0, 0, “Gill Sans MT Pro”, 16 )
– etc etc etc
end[/lua]
Then I’m including the call in the storyboard scene:
[lua]local storyboard = require “storyboard”
local subtab = require(“subtab”)
function scene1:createScene( event )
local group = self.view
subtab.addtab()
end;[/lua]
Everything works fine except that I don’t know how to add the objects created with the external module into the storyboard scene group. This means that these objects will no be removed from screen when changing scenes.
Help please,
Thanks [import]uid: 189638 topic_id: 33582 reply_id: 333582[/import]