View Single Post
Old 12-20-2018, 11:33 PM   #15
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,315
Default

Hmm...I think there are two more options. One, you add such an image-class yourself. Afaik, lokasenna did the class-concept for that purpose to make enhancing easier. But I never looked into it, so I can't help you with that(lokasenna, where ar thou?)

The other option is one, I use for the winterly snowflakes-function in my API, replacing the gfx.update()-function.

1. Copy gfx.update into a variable, like oldgfxupd=gfx.update
2. Write a new one, that blits the image and run oldgfxupd()
3. Before blitting, store the old values of gfx.x and gfx.y and restore them after blitting the image.

The function declaration is, as you are used to:
function gfx.update()

...Your blitting code here...

oldgfxupd()

end


The latter approach is more a hack that should work, but it may break with a future version of the gui-lib(though it's not likely to break).
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine is offline   Reply With Quote