Color points

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
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Color points

Post by samjith » Fri Jul 29, 2016 11:52 am

I need to colour lines that set by points.

sample code

Code: Select all

set the points of graphic "line" to the points of graphic "line" & cr & the mouseLoc
if i say "set the textcolor of the points of graphic "line" to "red".
the colour of all point changed to red.

How to colour some points in line?

I got a stack by
http://forums.livecode.com/viewtopic.ph ... 960#p85363

and referred
https://sites.google.com/a/pgcps.org/li ... g-programs

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

Re: Color points

Post by richmond62 » Fri Jul 29, 2016 5:41 pm

I don't believe you.

I ran this:

on mouseUp
set the textColor of the points of grc "path1" to "red"
end mouseUp


and got this:

button "Button": execution error at line 2 (Chunk: error in object expression) near "61,287", char 25

and I'm not in the least bit surprised as the points of a graphic object are not controls that have
properties, least of all the 'textcolor' property.

So, could you explain what you are doing, Please?

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

Re: Color points

Post by [-hh] » Fri Jul 29, 2016 11:27 pm

Richmond is right.
The "points" of a graphic are a list of numbers, they have no color property.

To colorize points/vertices of a graphic you can use (at most) foreColor, backColor, markerColor and markerFillColor *of the graphic*.

All vertices of a graphic become by that the *same* display (produced by the above color settings).

For different colorized points of graphics simply use different graphics.
There are a lot of sample stacks in this forum and in "Sample Stacks" that show how to do this.
[For example 'Mr. Polygony' is combined by several lines of different colors
http://forums.livecode.com/viewtopic.ph ... 16#p114016
or the points in the graphics here
http://forums.livecode.com/viewtopic.ph ... 07#p113907
are the points of two graphics (a red colored and a yellow colored one)].
shiftLock happens

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

Re: Color points

Post by richmond62 » Sat Jul 30, 2016 8:29 am

Nope:
pointless.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

Re: Color points

Post by richmond62 » Sun Jul 31, 2016 3:34 pm

Here's something really incredibly pointless: but, hey, whatever turns you on!
blobber.png
Stack removed as replaced by newer version below.
Last edited by richmond62 on Sun Jul 31, 2016 4:56 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

Re: Color points

Post by richmond62 » Sun Jul 31, 2016 4:56 pm

I begin to wonder if . . . . well, never mind; there's a good clinic near me.
blobber2.png
Attachments
Blobber.livecode.zip
Here's the stack.
(3.79 KiB) Downloaded 224 times

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

Re: Color points

Post by Klaus » Sun Jul 31, 2016 5:29 pm

richmond62 wrote:I begin to wonder if . . . . well, never mind; there's a good clinic near me.
:D :D :D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

Re: Color points

Post by richmond62 » Sun Jul 31, 2016 10:12 pm

I must be mad; otherwise that nonsense about colourising points of a graphic would not have got under
my skin so badly.

Although, when one stops and thinks about things the ability to mark the points of a graphic with some sort of coloured objects
is not necessarily a bad thing.
pointsBlobbed.png

Post Reply