@BN2
I decided to give Magic Windows a play and you know what, it's really easy to use! It only takes a couple of calls to get something up and running with pretty nice results.
I put together a simple 4 window demo. Three of the windows have random text scrolling in them each set to different colors. Then there is an fps window. You can drag the windows around, resize them, change their priority, close them if you like. It was really easy to do. And they overlap nicely.
remstart
==============================================================
= Title : Magic Windows Multiple Text Example
= Author : latch
= Date : 07/24/2009
= Update : 07/10/2012
= Version:
==============================================================
Comments
==============================================================
remend
rem =============================================================
rem = SET UP DISPLAY
rem =============================================================
autocam off
set display mode 800,600,32
sync on
sync rate 60
rem =============================================================
rem = MAIN
rem =============================================================
_main:
gosub _init
make object cube 1,25
position camera 0,0,-50
do
turn object right 1,1
pitch object down 1,1.7
rem random window and text
w=rnd(2)+1
for c=1 to rnd(100)+10
text$=text$+chr$(32+rnd(59))
next c
MW_Print(w,text$)
text$=""
rem randomly change the color of text in window 1
if timer()-tim > 500
MW_Ink(1,rnd(255),rnd(255),rnd(255))
tim=timer()
endif
rem display fps
fps$=str$(screen fps())
MW_Print(4,fps$)
rem automatic gadget handling active
MW_Background_Task()
MW_Sync(0)
rem custom resizing handling to avoid flashing in 3d mode
gosub _resize_window
sync
loop
end
rem =============================================================
rem = SUBROUTINES - PROCEDURES
rem =============================================================
_init:
#Include "MW_functionsDBv1.dba"
Rem magic windows global arrays
Dim _Windows_sys(34) : Dim _Windows_Order(24)
Dim _Windows_Data(24,32) : Dim _Windows_Title$(24) : Dim _Windows_Font$(24)
Dim _Windows_Gadget(24,32,8) : Dim _Windows_Gadget_Text$(24,32) : Dim _Windows_Text$(64)
Dim _Windows_Default(32,2) : Dim _MWLocale$(32)
dim fileselector$(9) : dim fileselectordata(13) : dim _filespath$(7) : dim _fichier$(256)
fileselector$(1)=get dir$() : fileselector$(2)="File Selector Title"
Dim _Menu_Option$(5,17) : Dim _Menu_State(5,17) : Dim _Menu_Logo(5,17) : Dim _Menu_sys(8)
rem initialize
MW_Initialize_Tiles(32768)
MW_Screen_Title_On()
MW_Set_Screen_Title("Magic-Windows Example: Text Box Demo")
rem create 3 windows with different sizes, positions, and text colors
MW_Open_New_Window(1,"test 1",200,200,1,1,1)
MW_Open_New_Window(2,"test 2",600,400,1,1,1)
MW_Ink(2,0,255,0)
MW_Position_Window(2,50,150)
MW_Open_New_Window(3,"test 3",200,200,1,1,1)
MW_Ink(3,255,0,255)
MW_Position_Window(3,500,0)
rem fps window
MW_Open_New_Window(4,"FPS Window",100,50,0,1,0)
MW_Position_Window(4,300,0)
MW_Disable_RealTime_Scaling()
return
`=======================================================
_resize_window:
rem the automatic resize causes a lot of screen flash when the backdrop is
rem on or you have to use a bitmap in 2d mode to be able to clear
rem the screen without drawing artifacts. This is a resizing procedure
rem to help avoid these situations
rem which window are we over
oc=nc
nc=(mouseclick()=1)
if nc > oc
win=MW_Current_Window()
gad=MW_Current_Gadget()
rem resize gadget is -5
if win
if gad=-5
x1=MW_Window_XPosition(win)
y1=MW_Window_YPosition(win)
endif
endif
endif
rem if the mouse is clicked and we are on the resscaling gadget
if nc and gad=-5
mx=mousex()
my=mousey()
line x1,y1,mx,y1
line x1,y1,x1,my
line x1,my,mx,my
line mx,y1,mx,my
newxsize=mx-x1
newysize=my-y1
endif
rem the button is released now size the window
if nc=0 and gad=-5
MW_Resize_Window(win,NewXSize,NewYSize)
win=0
gad=0
endif
return
Enjoy your day.