Hello again, I have made the code below, and it works as I wanted, it get the egg texture card for my game slot and generate more 8 copies of it in a way they are organized in a square fashion.
#automated slot generator and organizer
def slotGen(self):
x = 0.33
xx = 0
z = 0.46
#character creation slot button
holder = loader.loadModel(data.MYDIR + '/../graphics/2d/menus/ccslot')
holder.hide()
for i in range(1,10):
if i == 4:
xx = 0
z = 0.09
if i == 7:
xx = 0
z = -0.28
self.slotButton = DirectButton(relief = (None), pos = ( x + xx, 0, z ), geom = (holder.find('**/ccslotR'),
holder.find('**/ccslotH'),
holder.find('**/ccslotH'),
holder.find('**/ccslotR')))
xx += 0.38
Since directbutton create a copy of the model provided in holder, I made this variable(holder) local and I hid the source egg model.
The problem is, how would I acess the exact slot button I want if they all were created as self.slotButton? I´m not much of a programmer, so if I´m doing things wrong, I would be gratefull if you showed the right way, or a better way. The objective is to generate 9 slots based in a egg texture file, and giving me the possibility to control each slot individualy.
Any help concerning this problem is welcome.