You can make a slice visible/invisble with "set slice visible (sl, true)" and "set slice visible (sl, false)"
But you said you want two containers to be invisible and the third visible. This can be done using a Select slice. Just one child of a Select slice is visible, the others automatically become invisible. You use "set select slice index" (or "set selected child") for that:
Code: Select all
Select # This is a single menu item
Container
Sprite # One of the characters
Sprite
# etc
Container
Sprite # One of the characters
Sprite
# etc
Container
Sprite # One of the characters
Sprite
# etc
Write "set select slice index (sl, 0)" to make the first visible and other two invisible, "set select slice index (sl, 1)" to make the second visible, etc.
However! It's a lot of work to create all those slices; there's a much easier way. Don't create three copies of the text, just have one copy, and use the following script which changes the palettes of all the sprite children of a slice:
Code: Select all
script, change child palettes, parent, palette, begin
variable (child)
child := first sprite child (parent)
while (child) do (
set sprite palette (child, palette)
child := next sprite sibling (child)
)
end
So if your slice collection looks like this:
Code: Select all
Rectangle menu items
Container # This is the first menu item
Sprite # One of the characters
# etc
Container
Sprite # One of the characters
# etc
Container
Sprite # One of the characters
# etc
Then you can write:
Code: Select all
sl := slice child (menu items, selection) # Slice for new selection
change child palettes (sl, 2)
(The first line of code is from the script I posted earlier)