spacebuddy wrote:Is there anyway to make a textgadget or a HyperLinkGadget transparent?
I have a bitmap in the background and when I put a text gadget on the bitmap it has a box around it.
It should be possible but it requires an enormous amount of API code.
You would have to create your Window and all your Gadgets with API
calls and you wouldn't be able to use PB's functions to get and set the
Gadgets' attributes but have to use API calls instead of them. You would
even have to implement a callback for manipulating background color...
A much more simple approach would be to draw directly into your
background image with DrawText() instead of using a TextGadget.
Although of course this still wouldn't solve your problem with the
HyperLinkGadget. You would have to implement your own by using
and manipulating text drawn with DrawText()...
Code: Select all
OpenWindow(0, 200, 100, 256, 256, "With background image")
If LoadImage(0, #PB_Compiler_Home + "/examples/sources/Data/Background.bmp")
LoadFont(0, "Apple Chancery", 28, #PB_Font_Bold)
If StartDrawing(ImageOutput(0))
DrawingMode(#PB_2DDrawing_Transparent)
DrawingFont(FontID(0))
DrawText(20, 100, "Transparent Text", RGB(0, 0, 0))
StopDrawing()
EndIf
ImageGadget(0, 0, 0, WindowWidth(0), WindowHeight(0), ImageID(0))
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf