place backgrounds with backgroundBehavior to existing cards

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
ueliweb
Posts: 118
Joined: Wed May 11, 2011 9:47 am

place backgrounds with backgroundBehavior to existing cards

Post by ueliweb » Thu Feb 16, 2012 8:52 am

Hei

how I can place backgrounds with backgroundBehavior to existing cards?
If I create new cards this backgrounds will be placed automatical to the new card and they have all the same ID.

As I created many cards with very different functionality but I would like to add new background with backgroundBehavior, it looks so that I need to create new card and copy all object and scripts to the new card ...

is ther no way to palce it easy to existing cards? any suggestions?


thanks
ueliweb

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: place backgrounds with backgroundBehavior to existing ca

Post by bn » Thu Feb 16, 2012 9:55 am

Hei,

you can add manually backgrounds to existing cards by going to that card and then in the menu Object menuitem Place Group will be enabled. It offers you to place any of your backgrounds that are not already on the card.
Bildschirmfoto 2012-02-16 um 09.46.02.png

Alternatively you can use the place command to add a background to an existing card

Code: Select all

on mouseUp
   go card 3
   place background "myBackGround" onto this card
   go card 1
end mouseUp
See "place" command in the dictionary.

Kind regards

Bernd

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: place backgrounds with backgroundBehavior to existing ca

Post by jmburnod » Thu Feb 16, 2012 9:58 am

Hi ueliweb
Salut Bernd,

Code: Select all

place group "Mygrouo" onto cd 2
work also
Best regards

Jean-Marc
Last edited by jmburnod on Thu Feb 16, 2012 10:20 am, edited 2 times in total.
https://alternatic.ch

ueliweb
Posts: 118
Joined: Wed May 11, 2011 9:47 am

Re: place backgrounds with backgroundBehavior to existing ca

Post by ueliweb » Thu Feb 16, 2012 10:18 am

Bernd,
Jean-Marc,

Thanks very much!
Just to now how the key word to find it.

Whereas I wrote 'place' in this topic I diden't searched with it befor :(
Now I found it also in the LC User Guide ...
Last edited by ueliweb on Thu Feb 16, 2012 11:50 am, edited 1 time in total.
ueliweb

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: place backgrounds with backgroundBehavior to existing ca

Post by jmburnod » Thu Feb 16, 2012 10:21 am

Hi ueliweb

Bernd is right (one more)

Code: Select all

place group "Mygrouo" onto cd 2
work if the group is not a background

but not if it is a background

Best regards

Jean-Marc
https://alternatic.ch

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: place backgrounds with backgroundBehavior to existing ca

Post by Klaus » Thu Feb 16, 2012 7:54 pm

Bonsoir Jean-Marc,
jmburnod wrote:

Code: Select all

place group "Mygroup" onto cd 2
work if the group is not a background
but not if it is a background
yes, but this will work:

Code: Select all

place bg "Mygroup" onto cd 2
no matter if "Mygroup" is a group or a (group with) background (behavior)! :D

The difference between "group" and "background" is just the way LiveCode sees and counts ALL groups!
If you:

Code: Select all

put the number of groups
you will get the number of groups of the CURRENT card where the script is executed!

If you:

Code: Select all

put the number of backgrounds
you will get the number of ALL groups in the current stack where the script is executed, background behavior set or not!

Isn't it amazing? 8)


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: place backgrounds with backgroundBehavior to existing ca

Post by jmburnod » Thu Feb 16, 2012 8:27 pm

Guten Abend Klaus,

Code: Select all

place bg "Mygroup" onto cd 2
Yes, i tried that after my second post, but you're faster

Best from Geneva

Jean-Marc
https://alternatic.ch

fredigertsch
Posts: 38
Joined: Mon Jan 03, 2011 5:42 pm
Location: Switzerland, Burgdorf

Re: place backgrounds with backgroundBehavior to existing ca

Post by fredigertsch » Wed Jul 04, 2012 9:58 am

Guten Tag Klaus

And why

place bg "mygroup" does function and place background "mygroup" does not?

Best, Fredi

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: place backgrounds with backgroundBehavior to existing ca

Post by Klaus » Wed Jul 04, 2012 11:31 am

Hi Fredi,
place bg "mygroup" does function and place background "mygroup" does not?
bg = background!?

If you mean the difference between "group" and "background", see my post above.


Best

Klaus

fredigertsch
Posts: 38
Joined: Mon Jan 03, 2011 5:42 pm
Location: Switzerland, Burgdorf

Re: place backgrounds with backgroundBehavior to existing ca

Post by fredigertsch » Wed Jul 04, 2012 11:46 am

Hi Klaus

Yes, when I write "bg" (for background) then it does function but when I write "background" it does not. But it does move the group to the new card and I like only to copy the group??? I have several different groups on a card "vorlagen". Then I add a new card and I want to copy one of the groups on this card (it depends the type of the card). How I have to made it? Thanks.

Regards, Fredi from Switzerland

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: place backgrounds with backgroundBehavior to existing ca

Post by Klaus » Wed Jul 04, 2012 11:59 am

Grüezi Fredi,
fredigertsch wrote:Hi Klaus
Yes, when I write "bg" (for background) then it does function but when I write "background" it does not.
Really??? Lazy moi alway uses the abbreviations, so I never noticed his :D
fredigertsch wrote:...But it does move the group to the new card and I like only to copy the group?
It does not move the group! It is still on the original card but also on the new card where you placed it.
It is in fact the SAME group!
fredigertsch wrote:I have several different groups on a card "vorlagen". Then I add a new card and I want
to copy one of the groups on this card (it depends the type of the card). How I have to made it? Thanks.

Regards, Fredi from Switzerland
You already mentioned it!

If you really want to copy a group, well then:
...
copy grp "xyz" of cd "vorlagen" to cd 2
...
should do the trick 8)


Best

Klaus

fredigertsch
Posts: 38
Joined: Mon Jan 03, 2011 5:42 pm
Location: Switzerland, Burgdorf

Re: place backgrounds with backgroundBehavior to existing ca

Post by fredigertsch » Wed Jul 04, 2012 4:02 pm

Thank you Klaus - you are right.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”