How do i get properties of an element.

  • RedVelvetCake
    30th Jul 2017 Member 0 Permalink

    no i mean change the color live, i want to make it flash rainbow

  • jacob1
    30th Jul 2017 Developer 0 Permalink
    @RedVelvetCake (View Post)
    Deco color, or actual color? The default color of an element (for example, water being blue) can only be changed per-element, not per-particle. Deco color can be set on any particle.

    For deco color, set the "dcolor" property using the methods I mentioned earlier
    For actual color, do elem.property(ID, "Color",0xFF0000FF), where ID is the ID of the element you want to set, and the hex thing is the color in RGBA format

    @QuanTech (View Post)
    lol check the wiki before posting incorrect info



    Edit: actually, it sounds like you may want to use a graphics function here. Check the "legacy" api section on the wiki, it should be near the bottom. It's not an entirely simple explanation.
    Edited once by jacob1. Last: 30th Jul 2017
  • QuanTech
    30th Jul 2017 Member 0 Permalink

    Oh I think that requires graphics update functions, jacobq can help you with that. also, I messed up the order lol: elements.property(id,"Color",1234) I cant test because I am on my phone

  • RedVelvetCake
    30th Jul 2017 Member 0 Permalink

    it does nothing but lag tf out of my game

  • jacob1
    30th Jul 2017 Developer 1 Permalink
    Lua elements are incredibly laggy. But I bug in your code could be making it laggier than it needs to be. If you post it, I can look at it

    (well, tomorrow. I'm going to sleep now)