Skip to content

Content

Crutiatix edited this page Apr 10, 2017 · 10 revisions

Table containing attributes defining a attributes of content drawn inside of element.

You can draw inside an element by setting its content, using element:setContent(). It only takes a function as a parameter, which will be given the ref, x and y attributes. It's needed to add atributes x and y to position of any element which is drawn in content for make it move together with main element when is dragged.

  • Attribute of:
  • Attributes:
    • w = [number] (element.w) - virtual width of content. Important when scrolling.
    • h = [number] (element.h) - virtual width of content. Important when scrolling.
    • wrap = [bool] (false) - if true then clip content by borders of element
    • scroll = [table] ({x=0,y=0})- define initial scroll of content
      • x = [number] (0) - Number 0 - 1 defining content scroll. 0 is at left, 1 at right.
      • y = [number] (0) - Number 0 - 1 defining content scroll. 0 is at top, 1 at bottom.
  • Functions:
    • element:setContent ([function]) = set content of the element
      • arguments:
        • [function] - function containing drawing something
          • arguments:
            • [object] - a reference to element
            • [number] = x position of element's content (+border)
            • [number] = y position of element's content (+border)

Clone this wiki locally