tpt.graphics_func

  • xxx70307
    2nd Aug 2013 Member 0 Permalink

    how to use tpt.graphics_func

  • mniip
    2nd Aug 2013 Developer 0 Permalink
    you pass it a function and an element name
  • jacob2
    2nd Aug 2013 Member 0 Permalink
    Look under the legacy API section in the wiki, it has a very good description of how to use it.
  • boxmein
    2nd Aug 2013 Former Staff 0 Permalink
  • xxx70307
    12th Aug 2013 Member 0 Permalink

    ok, sorry for late coment

    elements.property(elements.YOUR_ELEMENT_ID, struct(index, colr, colr, colg, colb)) return 1, bit.bor(elem.PMODE_FLAT,elem.FIRE_ADD,elem.PMODE_ADD),100,255,0,0,100,255,0,0 end)end

    There is a problem with bit.bor

     

     

    Edited 2 times by xxx70307. Last: 12th Aug 2013
  • boxmein
    12th Aug 2013 Former Staff 0 Permalink
    elements.property(, "Graphics", function(index, colr, colr, colg, colb)
    -- return cache, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb
    return 1, bit.bor(elem.PMODE_FLAT,elem.FIRE_ADD,elem.PMODE_ADD),100,255,0,0,100,255,0,0
    end)


    You need to know the element's ID you are referring to, either what was returned from when you used elements.allocate(), or by referring to an existing element..

    Just
    err
    http://boxmein.x10.mx/tptelements/lua/