Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Scripting API suggestions => Topic started by: garry23 on September 28, 2017, 07:59:26 PM

Title: Display interactions
Post by: garry23 on September 28, 2017, 07:59:26 PM
@A1ex

Hope you can help.

In my focus bar script I'm writing text to the screen then, when not required, erasing.

I erase by simply overwriting in the transparent color.

Unfortunately this negatively interactions with ML drawing, eg the spot meter.

Is there a way to deal with this, ie after I've erased then ML, eg the spotmeter, doesn't know I was writing at that point.

Hope this s clear.

Cheers

Garry
Title: Re: Display interactions
Post by: a1ex on September 28, 2017, 08:16:40 PM
Not really; you could trigger a redraw, but that doesn't appear to be in the Lua API.

Canon uses a window system, but interfacing with it is not currently understood (we are just drawing over their screen), and writing one from scratch is not trivial.
Title: Re: Display interactions
Post by: garry23 on September 28, 2017, 08:36:53 PM
@a1ex

Thanks: understood.
Title: Re: Display interactions
Post by: garry23 on September 28, 2017, 11:16:31 PM
@A1ex

I just had a thought.

Would it be possible, worthwhile, to augment the display.clear() in Lua with display.clear(X1,y1, x2,y2).

Thus way we could clear chunks of the display without impacting key parts of the ML menus and displays.

Just a thought.

Cheers

Garry
Title: Re: (Partially Solved) Display interactions
Post by: garry23 on September 29, 2017, 08:50:48 AM
@A1ex

I've implemented a 'hack' that is a 99% solution.

What I have done is track that I've changed screen state and need to clear and redraw things, ie

Code: [Select]
if (not last_fd_LT_H) and fd < H then
                        display.clear()
                        display.off()
                        display.on()
                        local menu_item = menu.get("Overlay","Cropmarks")
                        if menu_item == 1 then
                            menu.set("Overlay","Cropmarks",0)
                            menu.set("Overlay","Cropmarks",1)
                        end
                    end

Hardly see the display flash :-)