SRL Archive - OSR Help

Dealing with a lot of constant points and colors


stata

2013-08-30 18:21:25

In one of my programs, I've got more points and associated colors than I can count. I was just wondering how you all keep your colors and points organized and looking nice.

Currently I'm considering having a type that contains a TPointArray and an Array of the colors associated with each of the points. I've also tried using a type in the past that consisted of the coords and the color (I called em colorpoints).

So what do you do? Just seperate arrays of colors and points? Maybe just hardcode everything? Custom types?

Sin

2013-08-30 18:33:21

Custom types seem really the way to go.


type ColorPoints
TP:TPoint;
aC:TIntegerArray;
end;

Then create an array of ColorPoints:


cPArray:array of ColorPoints

Set the length of the ColorPoints as you go.

if FindYourColorsAndTPA then
begin
SetLength(cPArray, Length(cpArray)+1);
//also set the length of the aC
cPArray[n].TP := storeTPointHere;
cPArray[n].aC := storeIntegersHere;

That should be a rough layout. Post if you need more help.

stata

2013-08-30 19:09:33

Yeah, as I stated in the OP, this is exactly what I do. I just wanted to see what other people were doing. Nn to show code, just a brief description will do :)

Is this what you do in your code or were you just translating my pseudo-code to actual code?

Ashaman88

2013-08-30 19:41:07

What objects are you looking for?