Transparent text
Posted: Sun Sep 13, 2015 11:34 am
Hello,
I'm trying to "simulate" a desktop in order to have movable icons. An icon is composed of an image and a text. Problem is, canvas cannot be transparent, so I figured I use a canvas for the image only, and a text gadget for the icon's title. But second problem, text gadgets cannot be colorized :
The text should be red. It remains black (at least on PB 5.40b3).
The point of using a text gadget is that the text is drawn on an alpha background, so it's fully transparent.
And I need a canvas to interact with mouse input (pressed, released, clicked, hovered, double clicked).
If only canvases could be transparent !
EDIT : hmm maybe I should have posted that in the Code section. Upon reflection, it has nothing related to Linux specifically...
I'm trying to "simulate" a desktop in order to have movable icons. An icon is composed of an image and a text. Problem is, canvas cannot be transparent, so I figured I use a canvas for the image only, and a text gadget for the icon's title. But second problem, text gadgets cannot be colorized :
Code: Select all
OpenWindow(0, 0, 0, 200, 200, "Text color test", #PB_Window_ScreenCentered)
TextGadget(0, 0, 0, 200, 200, "this is a text")
SetGadgetColor(0, #PB_Gadget_FrontColor, RGB(255,0,0))
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
The point of using a text gadget is that the text is drawn on an alpha background, so it's fully transparent.
And I need a canvas to interact with mouse input (pressed, released, clicked, hovered, double clicked).
If only canvases could be transparent !
EDIT : hmm maybe I should have posted that in the Code section. Upon reflection, it has nothing related to Linux specifically...