TstAddBorder.sel
#!./Selene
Selene.UseDirectFB("--dfb:quiet,no-vt")
DirectFB.init( DirectFB.CooperativeConst('FULLSCREEN') );
local srf = SelSurface.create { caps=SelSurface.CapabilityConst('PRIMARY') } local w,h = srf:GetSize() srf:Clear( 0xff, 0xff, 0, 0xff )
local txt = "This is a test" local font = SelFont.create("/usr/lib/ruby/gems/2.1.0/gems/rdoc-4.2.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf", { height=40, width=35} )
local fontw, fonth = font:StringWidth(txt), font:GetHeight() local ssrf,err = srf:SubSurface( 50,50, fontw+4, fonth+4 ) if not ssrf then
print('erreur :', err)
return
end
ssrf:SetFont( font ) ssrf:SetColor( 0x00, 0x00, 0x00, 0xff) ssrf:DrawString(txt, 0,0)
ssrf:DrawString(txt, 4,4)
print "Hit 'enter' key to exit"
io.stdin:read'*l'
ssrf:SetColor( 0xff, 0x00, 0x00, 0xff) ssrf:DrawString(txt, 2,2)
print "Hit 'enter' key to exit"
io.stdin:read'*l'