card with color palette

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
Shikha kumari
Posts: 19
Joined: Fri Feb 19, 2016 7:48 am

card with color palette

Post by Shikha kumari » Fri Feb 19, 2016 8:01 am

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.

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

Re: card with color palette

Post by Klaus » Fri Feb 19, 2016 9:20 am

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

Shikha kumari
Posts: 19
Joined: Fri Feb 19, 2016 7:48 am

Re: card with color palette

Post by Shikha kumari » Fri Feb 19, 2016 9:49 am

Thank you Klaus for your reply...
i will work on it..

Post Reply