Hi guys, i cant work this out. I can change gllines.nodecolor in the property editor and it works. But if i try to change it at runtime nothing happens.
ie.
gcol := tglcolor.Create(self);
gcol.red:=1;
gcol.green:=1;
gcol.blue:=0;
gllines.nodecolor:=gcol;
node should change to yellow but nothing happens .The node stays the same as set in the property editor.
Hi, I use code like this to assign line node colors at runtime.
var
I : Integer;
GLLines : TGLLines;
GLLinesNode : TGLLinesNode;
begin
.
.
.
for I := 0 to GLLines.Nodes.Count - 1 do begin
GLLinesNode := TGLLinesNode(GLLines.Nodes[I]);
GLLinesNode.Color.AsWinColor := clBlue;
end;
end;
If you want the line segments to have the same color, use this setting:
GLLines.Options := [loUseNodeColorForLines];
Lars
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks,that works for me. The nodecolor property seems buggy. It takes a tglcolor constant in the property editor but when you try this in code there is a type mismatch error between tglcolor and tvector4f.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys, i cant work this out. I can change gllines.nodecolor in the property editor and it works. But if i try to change it at runtime nothing happens.
ie.
gcol := tglcolor.Create(self);
gcol.red:=1;
gcol.green:=1;
gcol.blue:=0;
gllines.nodecolor:=gcol;
node should change to yellow but nothing happens .The node stays the same as set in the property editor.
any help appreciated.
thanks
Hi, I use code like this to assign line node colors at runtime.
var
I : Integer;
GLLines : TGLLines;
GLLinesNode : TGLLinesNode;
begin
.
.
.
for I := 0 to GLLines.Nodes.Count - 1 do begin
GLLinesNode := TGLLinesNode(GLLines.Nodes[I]);
GLLinesNode.Color.AsWinColor := clBlue;
end;
end;
If you want the line segments to have the same color, use this setting:
GLLines.Options := [loUseNodeColorForLines];
Lars
thanks,that works for me. The nodecolor property seems buggy. It takes a tglcolor constant in the property editor but when you try this in code there is a type mismatch error between tglcolor and tvector4f.