I don't think add_clone() and clone() are the same functions. From the Squirrel reference manual I'm reading (
https://developer.electricimp.com/squirrel/squirrelcrib), clone() specifically says it can clone an object.
Duplicating Objects
Squirrel provides a keyword, clone, to duplicate entities — objects, tables or arrays — which are usually accessed by reference rather than value. Any such entities nested within the clone’d object will not by copied, but accessed by reference. However, they themselves may be clone’d separately — and, indeed, any objects, tables arrays nested within them — and added to the clone.
In the Attract Mode Programming Reference, though, it documents add_clone() as:
fe.add_clone( img )
Clone an image, artwork or surface object and add the clone to the back of Attract-Mode's draw list. The texture pixel data of the original and clone is shared as a result.
Parameters:
img - the image, artwork or surface object to clone. This needs to be an instance of the class fe.Image.
Return Value:
An instance of the class fe.Image which can be used to interact with the added clone.
Dunno. No biggie of course, but it would sure be a lot cleaner when adding strokes if we could simply clone one of the 4 text objects, instead of writing it out 4 times.
And oops, I had a math error in the way I was generating the stroke. I modified the code above to fix it:
// offset the position of the stroked versions
lb1.set_pos( lb.x+1, lb.y+1 )
lb2.set_pos( lb.x+1, lb.y-1 )
lb3.set_pos( lb.x-1, lb.y+1 )
lb4.set_pos( lb.x-1, lb.y-1 )
And I see that the zipped layout I included doesn't work, oops again, I'll fix that one later.