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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      164 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      318 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      246 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X