# Class: l2dnode

A node meant for 2d drawing

## Hierarchy

    o-+ l2dlist
      o-+ l2dnode
        o-- l2dflag
        o-- l2dimage
        o-- l2dnode3d
        o-- l2dtext
        o-- l2dview3d

## Interfaces:

- renderflag

## Methods:

### Method overview:

- color
- delete
- firstchild
- local2world
- new
- parent
- pos
- rotcenter
- rotdeg
- rotrad
- scale
- scissor
- scissorlocal
- scissorparent
- scissorsize
- scissorstart
- sortid
- swapinchildlist
- world2local

new (string name)
  returns: (l2dnode)
  returns a new l2dnode, that can be used for hierarchy and organisation
color (l2dnode,[float r,g,b,a])
  returns: ([float r,g,b,a])
  returns or sets l2dnode's color
delete (l2dnode)
  returns: ()
  deletes node.
firstchild (l2dnode,[l2dnode])
  returns: ([l2dnode])
  returns or sets first child of the children list. First child is rendered first. Useful for manual sorting.
local2world (l2dnode,float x,y,z)
  returns: (float x,y,z)
  returns coordinates after transforms. l3dtargets will not be taken in account.
parent (l2dnode,[l2dnode parent])
  returns: ([l2dnode])
  returns or sets parent node. Passing a non l2dnode will unlink from parent. If linked will inherit transforms of parents and also won't be drawn if parent is not drawn. ==parent prevents gc of self, unless parent is root.
pos (l2dnode,[float x,y,z])
  returns: ([float x,y,z])
  returns or sets l2dnode's position
rotcenter (l2dnode,[float x,y,z])
  returns: ([float x,y,z])
  returns or sets l2dnode's center of rotation
rotdeg (l2dnode,[float x,y,z])
  returns: ([float x,y,z])
  returns or sets l2dnode's rotation in degrees
rotrad (l2dnode,[float x,y,z])
  returns: ([float x,y,z])
  returns or sets l2dnode's rotation in radians
scale (l2dnode,[float x,y,z])
  returns: ([float x,y,z])
  returns or sets l2dnode's scale
scissor (l2dnode,[boolean])
  returns: ([boolean])
  returns or sets if scissoring should be used. If scissoring is enabled only pixels within scissor rectangle are drawn. Makes sure proper scissorsize and scissorstart are set.
scissorlocal (l2dnode,[boolean])
  returns: ([boolean])
  returns or sets if own scissorstart is transformed with the node's matrix. The size is not transformed.
scissorparent (l2dnode,[boolean])
  returns: ([boolean])
  returns or sets if parent's scissor information is used as well. If own node has no scissor set we will use parents, else we cap own with parent's
scissorsize (l2dnode,[float x,y])
  returns: ([float x,y])
  returns or sets scissor rectangle size.
scissorstart (l2dnode,[float x,y])
  returns: ([float x,y])
  returns or sets scissor rectangle startpoint.
sortid (l2dnode,[int])
  returns: ([int])
  returns or sets l2dnode's sortid (lower gets rendered first). Setting a value will result into the parent's children list being resorted.
swapinchildlist (l2dnode,l2dnode)
  returns: ()
  swaps the children within the parent's childlist.
world2local (l2dnode,float x,y,z)
  returns: (float x,y,z)
  returns coordinates in localspace. l3dtargets will not be taken in account.

## Inherited Methods:

### From l2dlist