Menu

setting gllines nodecolor property.

Help
2015-05-16
2015-05-16
  • steven smith

    steven smith - 2015-05-16

    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

     
  • lnebel

    lnebel - 2015-05-16

    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

     
  • helmut

    helmut - 2015-05-16

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.