Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8: Extending a rectangle in Ninjascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NT8: Extending a rectangle in Ninjascript

    Greetings

    My intent is to extend a rectangle that has been created via Ninjascript under certain conditions. The following code does not work:

    Rect rect = Draw.Rectangle(this, tag, false, 2,
    High[2], 0, Low[2], Brushes.Black,
    Brushes.Gray, 1);
    ...
    ...
    ...

    rect.EndAnchor.BarsAgo = 0;

    The alternative is to just create another rectangle with the same tag as the current one. This is a highly inefficient way of achieving this goal.

    Please advise.

    Thanks in advance.




    #2
    Hello svrz,

    Thank you for the question.

    The suggestion in this case would be to call the Draw method again to update the object with the same tag, this is the normal way to update a drawing object. If you are seeing performance impacts due to using many objects, it is generally suggested to instead use OnRender to do the drawing.

    I look forward to being of further assistance.

    Comment


      #3
      Thank you, Jesse. This is a simple drawing operation hence there does not seems to be any performance issues with the re-drawing of the rectangles.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      60 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      39 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      21 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      23 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      51 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X