why dont this work?

mznznlt - Custom level - from Android
PlayEditOne player liked this.Log in to like this level.

im trying to make a library lua that would draw ui elements, but its not drawing like its supposed to.
The lib:call woks fine when using a numfeed, but fails to draw on UI. however, when i use the function inside the library lua, it works fine. it just doesnt work when called from another lua. a bug or am i doing sth wrong?

Views: 655 Downloads: 71 Unique objects: 2 Total objects: 2

Discuss this level

Log in to comment on this level.
  • zardOz2: @pajlada: I heard angels singing... did somebody say lines on top of sprites? thx p
  • Demon666: @pajlada: you guys know about the problem of not being able to drawlines on top of sprites right?
  • pajlada: Has been fixed in the next patch, thanks :)
  • Demon666: yeah I got the same results.... I think something it wrong with the draw_sprite() function itself because it works with draw_line() tho.... but only if you switch the code from each lua
  • pajlada: Thanks, this is why it occurs:
    When a LuaScript object runs its "solve" function in our code, it begins by first clearing any draw data that remained from the previous run.
    This has, so far, worked well for us. But in some cases, the LuaScript objects call their solve-functions in the "wrong" order; so their calls look like this:

    lua1:solve()
    lua1:call_step()
    {
    lua2:draw_stuff()
    }
    lua2:solve() -- the draw data is removed here, before they get the chance to render
    lua1:render()
    lua2:render() -- no draw-data to render, because it was cleared! :(

LEVEL ID: 10617