I have written up an example. I was watching my bro play a game that had transparent windows the other day and I thought that would be cool to make. When I read your post I thought I would give it a go.
Set display mode 1280,1024,32
Sync On : Sync Rate 60
`Globals For Our Mouse Update Function
Global LastMClick as Integer
Global MClick as Integer
Global ButtonState as String
`Set Our Window Paramaters
Global WindowName as String : WindowName="MyWindow"
Global WindowWidth as Integer : WindowWidth=200
Global WindowTitleHeight as Integer : WindowTitleHeight=20
Global WindowHeight as Integer : WindowHeight=300
Global WindowX as Integer : WindowX=50
Global WindowY as Integer : WindowY=50
Global BorderColor as Dword : BorderColor=Rgb(2,2,2)
Global TitleColor as Dword : TitleColor=Rgb(0,50,255)
Global WindowNameColor as Dword : WindowNameColor= Rgb(222,2,2)
Global WindowColor as Dword : WindowColor= Rgb(1,1,1)
Create Bitmap 1,Screen Width(),Screen Height()
Set Current Bitmap 1
cls rgb(0,0,255)
`Create Our Window
Ink BorderColor,1
Box WindowX,WindowY,(WindowX+WindowWidth),(WindowY+WindowTitleHeight+WindowHeight)
Ink TitleColor,1
Box WindowX+1,WindowY+1,(WindowX+WindowWidth)-1,(WindowY+WindowTitleHeight)-1
Ink WindowNameColor,1
Text WindowX+4,WindowY+4,WindowName
Ink WindowColor,1
Box WindowX+1,WindowY+WindowTitleHeight-1,(WindowX+WindowWidth)-1,(WindowY+WindowHeight+WindowTitleHeight)-1
`Store Our Window To an Image
Get Image 1,WindowX,WindowY,(WindowX+WindowWidth),(WindowY+WindowTitleHeight+WindowHeight)
Delete Bitmap 1
Set Current Bitmap 0
`Create Our Windows Transparency
SetColorAlpha(1,2,"1,1,1",150)
`Create a Funky Background
Create Bitmap 1,Screen Width(),Screen Height()
Set Current Bitmap 1
Cls Rgb(0,100,0)
Ink Rgb(255,255,255),1
For aText=1 to 200
Text Rnd(Screen Width()),Rnd(Screen Height()),"Hello World"
Next aText
`Store Our Window To an Image
Get Image 3,0,0,Screen Width(),Screen Height()
Delete Bitmap 1
Set Current Bitmap 0
Do
UpdateMouse()
Paste Image 3,0,0
Paste Image 2,WindowX,WindowY,1
set cursor 0,0 : Print Mousex(), Mousey() : MoveWindow()
Sync : cls
Loop
Function SetColorAlpha(ImageNumber as Integer, NewImageNumber as Integer ,Color as String, Transparency as Byte)
Make Memblock from Image 1,ImageNumber
Local Width as Dword : Width = Memblock Dword(1,0)
Local Height as Dword : Height = Memblock Dword(1,4)
Local Depth as Dword : Depth = Memblock Dword(1,8)
Local PixelPointer as Integer PixelPointer=12
For Y=1 to Height
For X=1 to Width
PixelColor as String
PixelColor=Str$(Memblock Byte(1 , PixelPointer+2)) + "," + Str$(Memblock Byte(1 , PixelPointer+1)) + "," + Str$(Memblock Byte(1 , PixelPointer))
If PixelColor=Color
Write Memblock Byte 1, PixelPointer+3,Transparency
EndIf
PixelPointer=PixelPointer+4
Next X
Next Y
Make Image From Memblock NewImageNumber,1
EndFunction
Function MoveWindow()
If MousePosX>WindowX and MousePosX<(WindowX+WindowWidth)
If MousePosY>WindowY and MousePosY<WindowY+WindowTitleHeight+10
If ButtonState="LeftPressed"
Global DistanceX as Integer : DistanceX=WindowX-Mousex()
Global DistanceY as Integer : DistanceY=WindowY-Mousey()
EndIf
If ButtonState="LeftHeld"
WindowX = Mousex()+ DistanceX
WindowY = Mousey()+ DistanceY
EndIf
EndIf
EndIf
Global MousePosX as Integer : MousePosX = Mousex()
Global MousePosY as Integer : MousePosY = Mousey()
EndFunction
Function UpdateMouse()
LastMClick=MClick
MClick=MouseClick()
`Mouse is not held Down
if MClick=0 and LastMClick=0 then ButtonState="NotPressed"
`LeftMouse is held Down
if MClick=1 and LastMClick=0 then ButtonState="LeftPressed"
`LeftMouse has just Been Pressed
if MClick=1 and LastMClick=1 then ButtonState="LeftHeld"
`LeftMouse has just been Lifted
if MClick=0 and LastMClick=1 then ButtonState="LeftLifted"
`RightMouse has just been Pressed
if MClick=2 and LastMClick=0 then ButtonState="RightPressed"
`RightMouse is held Down
if MClick=2 and LastMClick=2 then ButtonState="RightHeld"
`RightMouse has just been Lifted
if MClick=0 and LastMClick=2 then ButtonState="RightLifted"
Endfunction
Better to be dead, than to live your life afraid.