also on a canvas if the frontcolor is transparent and the font backcolor is not, the font will not display the background image under the font.
but display the font backcolor.
Code: Select all
InitSprite()
Global main=OpenWindow(#PB_Any,800,600,800,600,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
Global scr=OpenWindowedScreen(WindowID(main),0,0,800,600)
Global fnt=LoadFont(#PB_Any,"consolas",16)
; dessine un fond aleatoire pour le test
StartDrawing(ScreenOutput())
For k=0 To 24
LineXY(0,k,24,k,RGB(Random(200)+55,Random(200)+55,Random(200)+55))
Next
fond=GrabDrawingImage(#PB_Any,0,0,24,24)
StopDrawing()
; affiche les glyphes de la font par dessus le fond en transparence... ne fonctionne pas
For a =032 To 255
WaitWindowEvent(0)
ClearScreen(0)
StartDrawing(ScreenOutput())
DrawingFont(FontID(fnt))
DrawImage(ImageID(fond),0,0)
DrawImage(ImageID(fond),0,24)
DrawingMode(#PB_2DDrawing_AlphaBlend)
FrontColor(RGBA(255,255,255,100)) ; devrait etre transparent (alpha a zero)
BackColor(RGBA(0,0,0,100))
DrawText(0,0,Chr(a))
DrawText(0,24,Chr(a),RGBA(0,0,0,0),RGB(255,255,100)); devrait etre transparent (alpha a zero)
StopDrawing()
FlipBuffers()
Delay(100)
Next