Lua Widget, SHADOWED and BLINK not working
Posted: Sun Aug 11, 2019 7:44 am
Hi all,
I am struggling with the SHADOWED and BLINK flags in my widget.
They dont function.
This my code to test it.
I am struggling with the SHADOWED and BLINK flags in my widget.
They dont function.
This my code to test it.
Code: Select all
local options = {
{ "Color", COLOR, WHITE },
{ "Shadow", BOOL, 0}
}
function create(zone, options)
local Context = { zone=zone, options=options }
return Context
end
-- This function allow updates when you change widgets settings
local function update(Context, options)
Context.options = options
end
function ScreenUpdate(Context)
lcd.drawText(Context.zone.x, Context.zone.y - 8, "Hello" , CUSTOM_COLOR + DBLSIZE + shadowed + BLINK)
end
function update(Context, options)
Context.options = options
Context.back = nil
end
function refresh(Context)
lcd.setColor(CUSTOM_COLOR, Context.options.Color)
if Context.options.Shadow == 1 then
shadowed = SHADOWED
else
shadowed = 0
end
ScreenUpdate(Context)
end
return { name="ShadowTest", options=options, create=create, update=update, refresh=refresh }