Same background on every card

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
gsillevis
Posts: 40
Joined: Tue Oct 13, 2020 10:55 pm

Same background on every card

Post by gsillevis » Fri Nov 06, 2020 3:46 pm

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!

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Same background on every card

Post by Klaus » Fri Nov 06, 2020 3:53 pm

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.

gsillevis
Posts: 40
Joined: Tue Oct 13, 2020 10:55 pm

Re: Same background on every card

Post by gsillevis » Fri Nov 06, 2020 4:00 pm

Thank you I'll give it a try!

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Same background on every card

Post by mrcoollion » Sat Nov 07, 2020 10:26 am

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 -

Post Reply