Any way to move brush in the simulation?

  • PowderMan1372
    10th November Member 0 Permalink

    I've been working on a Lua script, but it requires me to move the brush to a certain position. Looking through the docs I couldn't find anything of use. If it isn't possible to do so (for security reasons or something similar), I wouldn't mind finding an alternative. Thank you.

    Edited once by PowderMan1372. Last: 10th November
  • Jerehmia
    11th November Member 0 Permalink

    What do you need the brush for? If it's to spawn particles you could use simulation.createParts():

    sim.createParts(100, 100, 20, 10, elem.DEFAULT_PT_ROCK, sim.BRUSH_TRIANGLE)

    Creates a triangle of ROCK particles with a width of 20 pixels and a height of 10 pixels at position 100, 100 as if they were painted with the triangle brush.

  • PowderMan1372
    11th November Member 0 Permalink

    I need the brush because I'm developing a 'brush position stack' that allows you to save brush positions and instantly return to them whenever needed.

  • LBPHacker
    11th November Developer 0 Permalink
    This is not possible, not even for security reasons but simply because the brush is meant to follow the user's mouse movements and nothing else. No security, just design.
  • Maticzpl
    11th November Member 0 Permalink

    You can move the zoom scope though. If the user has their mouse inside the zoom window, then you can move which part of the screen the zoom window is looking at effectively moving the brush.

  • PowderMan1372
    12th November Member 0 Permalink

    Thank you.