Page 1 of 1

Same background on every card

Posted: Fri Nov 06, 2020 3:46 pm
by gsillevis
Hello!

I would like to use the same background image on every card ("Background.png"). However, to avoid having an extra copy on every card (and therefore ballooning the app size) I thought I might use a referenced control image instead.

What can I do to make sure the file path works when I save it as an HTML5 standalone?

Or is there a smarter way to put the background file on every card?

Thank you in advance for your help!

Re: Same background on every card

Posted: Fri Nov 06, 2020 3:53 pm
by Klaus
The trick here is to use only ONE image! :D
Do this:
1. Import the image (or set the filename)
2. GROUP that single image
3. Now you can PLACE that group on every card you want to.
What can I do to make sure the file path works when I save it as an HTML5 standalone?
Sorry, never used HTML5 export.

Re: Same background on every card

Posted: Fri Nov 06, 2020 4:00 pm
by gsillevis
Thank you I'll give it a try!

Re: Same background on every card

Posted: Sat Nov 07, 2020 10:26 am
by mrcoollion
In LiveCode you can change a group into a background by changing its background property. This will place that group (including the controls owned by that group) on every card created thereafter. If you have already created a bunch of cards you can always add the group by selecting the menu Object > Place Group. The message path then goes from the card to the background to the stack.

See https://livecode.fandom.com/wiki/Group
See https://lessons.livecode.com/m/4071/l/1 ... iple-cards

regards,

- Paul -