R2::BeginElement


unsigned R2::BeginElement()

This method begins an element.

Return

unsigned

The identity of the element.

Notes

If the element exists, it is reset to empty when being opened. If the element doesn't exist, a new element is created.

If drawing is done without beginning an element, each drawing instruction causes the generation of an element. That element has a single drawing instruction in it. Using this method, multiple graphics orders may be added to a single element. The method R2::EndElement() should be used to end an element begun with this method.

A segment is a dynamic array of elements with the identity of an element being the key of the array element. By default, the array is populated starting with index 0 and proceeding upwards by 1 from there. This function increments the element pointer by 1. The dynamic array of elements can be sparse. It is drawn in ascending element order. The method R2::SetElementPointer may be used to set the element pointer at a specified offset. The method R2::OffsetElementPointer may be offset forward in the element array, relative to the current position. The methods R2::CreateLabel and R2::GoToLabel may be used to manipulate the element pointer using labels.