From time to time, when you learn stuff, it can happen that you made things that already exists, its new for me that this is bad. I have not said that I made this accessibly here or somewhere else for other people.
Anyway, I found a way, is not exactly what i want, but i can live with that.
For anyone who`s interested in here is the code:
int $section = 0; //can be anything from 0 - 9
string $text = "This means nothing";
makeHUD $section $text;
proc makeHUD (int $section, string $text)
{
if( headsUpDisplay -exists blahHUD
!= 1 )
headsUpDisplay
-section $section
-block getFreeBlock $section
-blockSize "small"
-label $text
-labelFontSize "small"
-dataFontSize "small"
-labelWidth 0
blahHUD;
else
headsUpDisplay -remove blahHUD;
}
proc int getFreeBlock (int $section)
{
// list all HUDs
string $hList[] =
headsUpDisplay -listHeadsUpDisplays;
int $bContent[];
// go through all the HUD
s
for( $currentHUD in $hList )
if( headsUpDisplay -query -section $currentHUD
== $section )
{
int $block = headsUpDisplay -query -block $currentHUD
;
$bContent[$block] = 1 ;
}
// find the free block
for( $i = 0; $i < size( $bContent ); $i++ )
if( ! $bContent[$i] )
break;
return $i;
}