Troubleshooting
How to use Switches to change the bitmap of a CustomButton
Started by Jeshua on .
Sign in or create an account to join the conversation.
I have 4x2 switch object that I want to use to change a CustomButton's bitmap offstate to four different symbols according to which switch is on.
How would I make this script?
Thank you
How would I make this script?
Thank you
Subject: Re: How to use Switches to change the bitmap of a CustomButt
And what do you want to happen when no switch is on (out of the 4x2 ones) OR when more than two buttons are on?Subject: Re: How to use Switches to change the bitmap of a CustomButt
here's an example with the modifier switches set to radio.....The first one "resets" the custom button to display text, the rest set to a few example bitmaps (out of the 14 range)....changingbitmaps.jzml
Subject: Re: How to use Switches to change the bitmap of a CustomButt
you call up the 'bitmap' attribute of the CustomButton. Something like this:decl i=firstof(Switches.x);
setattribute(CustomButton, 'bitmap', i);
Thanks for the idea, I wasn't aware of this bitmap attribute.Ups, Softcore was faster.
Subject: Re: How to use Switches to change the bitmap of a CustomButt
Answering posts like this = the best exercise for learning Lemur! ...or should I say:
On expression forum question, any
decl learn, try;
try = make a sample project;
if (try==1) learn=1;
else learn=0;
lol lol lol lol lol lolSubject: Re: How to use Switches to change the bitmap of a CustomButt
Higetattributelist(object) is a handy one to just chuck in a monitor to check whats possible whilst coding . .
Or print out the appendix bits from the guide as well . . .
I keep meaning to post my attribute lister thing . . .
MM
Subject: Re: How to use Switches to change the bitmap of a CustomButt
I keep going back to the manual for the attributes - just followed your advice and made a Monitor module with the getattribute script to have ready to drop in future designs and get the attributes of an object fast!Nice one!
Subject: Re: How to use Switches to change the bitmap of a CustomButt
I wasn't aware of that one either.Macciza wrote:Hi
getattributelist(object) is a handy one to just chuck in a monitor to check whats possible whilst coding . .
Cool stuff, thanks!
Subject: Re: How to use Switches to change the bitmap of a CustomButt
Worked like a charm folks. I'll bring the questions if you guys supply such great answers