Mousecolor weirdness and losing hair!

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

gstrekkie
Posts: 27
Joined: Tue Aug 20, 2013 11:43 pm

Mousecolor weirdness and losing hair!

Post by gstrekkie » Sun Jul 20, 2014 8:04 am

ok below is a snippet of the code that works fine on a card in another stack. I copied over the card to my new stack it worked briefly and now just returns 0,0,0 all the time I have set up a new card doing the same darn thing and still its no good. what the fork I loose too much sleep when things like this happen so if someone knows what I did wrong or what deities i need to submit a sacrifice to. please take pity on my doomed soul. I saw there was a bug in earlier versions of lc so I tried with what versions I have I will install something older too to try if I get something that works ill share the info here...

Code: Select all

on touchmove
   
   set the backgroundColor of graphic "theColorPreview" to the mousecolor
   
   put the mouseColor into thecolor

set the numberFormat to "###"

put formathex(baseConvert(item 1 of thecolor,10,16)) into R
 put formathex(baseConvert(item 2 of thecolor,10,16)) into G
 put formathex(baseConvert(item 3 of thecolor,10,16)) into B
 
 put baseconvert (R,16,10) into rd
 put baseconvert (G,16,10) into gd
 put baseconvert (B,16,10) into bd
 setsliders rd,gd,bd

end touchmove

gstrekkie
Posts: 27
Joined: Tue Aug 20, 2013 11:43 pm

Re: Mousecolor weirdness and losing hair!

Post by gstrekkie » Sun Jul 20, 2014 9:13 am

I created a new stack from scratch and the above code works as expected, curiouser and curiouser.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Mousecolor weirdness and losing hair!

Post by [-hh] » Sun Jul 20, 2014 11:48 am

..........
Last edited by [-hh] on Wed Aug 13, 2014 3:36 pm, edited 1 time in total.
shiftLock happens

gstrekkie
Posts: 27
Joined: Tue Aug 20, 2013 11:43 pm

Re: Mousecolor weirdness and losing hair!

Post by gstrekkie » Sun Jul 20, 2014 5:29 pm

Thanks for helping streamline my code with the setslider optimization but unfortunately mousecolor is the culprit it keeps returning 0,0,0 before it gets to my cludgy code. All of this was working and continues to work on other stacks that I have tried. I have also deleted the offending card from my stack and tried using mousecolor in its most basic of forms and it always returns 0,0,0 . Something in my stack is interfering with the way the function operates. I am currently using some mergext extensions and tmcontrol2 on other cards . They are also working along with this code in other stacks so I am dumbfounded and will dump and remix and start over I guess. Also as a post script is it possible that dragging the card from one of my other stacks into this stack using the project browser (can't think of correct name right now) that I broke my stack because I was being lazy?

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Mousecolor weirdness and losing hair!

Post by [-hh] » Mon Jul 21, 2014 7:57 am

..........
Last edited by [-hh] on Wed Aug 13, 2014 3:36 pm, edited 2 times in total.
shiftLock happens

gstrekkie
Posts: 27
Joined: Tue Aug 20, 2013 11:43 pm

Re: Mousecolor weirdness and losing hair!

Post by gstrekkie » Mon Jul 21, 2014 8:50 am

Thanks -hh
I will give both of your suggestions a try and report back my progress!

gstrekkie
Posts: 27
Joined: Tue Aug 20, 2013 11:43 pm

Re: Mousecolor weirdness and losing hair!

Post by gstrekkie » Mon Jul 21, 2014 9:53 am

That did not work either something got really gronked up so I restarted the whole shebang thanks for the help though we gave it a good try I will revisit it to see if i can ever get it to work but I think something got fouled up when I copied over the card. if it is strange and it can happen then I usually find it the hard way....

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Mousecolor weirdness and losing hair!

Post by bn » Mon Jul 21, 2014 10:22 am

Hi gstrekkie,

here is another take at the mouseColor. It reports any color under the mouse all over the screen. And it is simple. And best of all it makes hair grow.

The trick here is that any built-in message like mouseMove only operates within the boundaries of the stack. If however you do a "send in time" to query the mouseColor it will happily report the mouseColor from everywhere.

Kind regards
Bernd
Attachments
theMouseColor.rev.zip
(1.1 KiB) Downloaded 263 times

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Mousecolor weirdness and losing hair!

Post by Da_Elf » Sat Dec 27, 2014 5:12 pm

im looking at this code and all seems to make sense in the code yet im only getting 0,0,0. note im on LC 6.5

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Mousecolor weirdness and losing hair!

Post by bn » Sun Dec 28, 2014 2:05 pm

Im looking at this code and all seems to make sense in the code yet im only getting 0,0,0. note im on LC 6.5
do you use it on an iOS device? Or on desktop.

Just tested on 6.7.1 desktop Mac and iPad and it worked. There was some inaccuracies when setting the stack to "letterbox" on preOpensack which I did not investigate further. Do you use autoScaling?

Which version of 6.5? I think the latest of the 6.5 series is 6.5.2.

What operating system?

Kind regards

Bernd

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Mousecolor weirdness and losing hair!

Post by Da_Elf » Tue Dec 30, 2014 1:15 am

desktop LC 6.5.0 build 3009. Returns 0,0,0. ive been nervous to do the updates since when i tried to update to the 7 series my "answer file" function wasnt working so i went back to the last one i was working with that worked

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Mousecolor weirdness and losing hair!

Post by bn » Fri Jan 02, 2015 4:49 pm

desktop LC 6.5.0 build 3009. Returns 0,0,0. ive been nervous to do the updates since when i tried to update to the 7 series my "answer file" function wasnt working so i went back to the last one i was working with that worked
I tested on desktop for 6.5.2 and it worked.

Do you want this for mobile? Could not test with 6.5.2 and mobile iOS since 6.5.2 does not recognize my Xcode version.

What is your operating system?

By the way 6.6.5 is the latest of the 6.0 series before refactoring. You should at least be able to use that. I do use 6.7.1 for most development and test on 7.0.1.

I have quite a number of versions side by side on my computer, no harm with that. Just note that 7.x.x series has a different native format for saved stacks, and different preferences.

Kind regards

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Mousecolor weirdness and losing hair!

Post by Dixie » Fri Jan 02, 2015 5:08 pm

Hi...

Bernds' stack work in the iPhone simulator using xCode 6.1, LC 7.0...

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Mousecolor weirdness and losing hair!

Post by bn » Fri Jan 02, 2015 5:35 pm

Dixie,
thanks for testing.

@da_elf

what exactly do you want to do? The stack I posted is most useful for desktop use since it works even outside of the boundaries of a stack. When using it on mobile devices there might be an easier way to do it since you will always be within the boundaries of the stack anyways.

Kind regards
Bernd

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Mousecolor weirdness and losing hair!

Post by Da_Elf » Fri Jan 02, 2015 9:41 pm

i was testing it on a pc win7

Post Reply