Page 1 of 1

card with color palette

Posted: Fri Feb 19, 2016 8:01 am
by Shikha kumari
how can i pixel a card so that each pixel could be programmed separately?

Actually i am trying to fix a card in my project where color palette will be shown and once i clicked on any pixel containing different color the whole of my text changes into the selected color.

As i am beginner to live code please explain so that i could proceed in my project.

Re: card with color palette

Posted: Fri Feb 19, 2016 9:20 am
by Klaus
Hello Shikha kumari,

1. welcome to the forum! :D
2. You could use 1*1 pixel (or maybe a LITTLE bigger, it is hard to hit 1*1 pixel objects with the mouse 8) )
opaque graphics with no border, group them and apply a script to the group.

Do like this:
Create a field
Create as many graphics as you need, no border, opaque
Set their fillcolor to the color you like
Select all these graphics
GROUP them -> CMG-G or menu "Object" -> Group selected
Apply this script to the new GROUP:

Code: Select all

on mouseup
  set the textcolor of fld "your field name here" to the backcolor of the target
end mouseup
Done, tested and works :D

Here some great learning resources for the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html

Hint: Look up all terms in the dictionary to learn more about them!


Best

Klaus

Re: card with color palette

Posted: Fri Feb 19, 2016 9:49 am
by Shikha kumari
Thank you Klaus for your reply...
i will work on it..