I need help, I can not draw behind each text a black rectangle and that this rectangle when maximizing or adjusting the screen is kept next to the text.
I don't understand how to use Viewport Drawing Methods to make the black rectangular drawing stay behind the text

macroScript StatisticsInfo
category:"DG3Duy"
toolTip:"StatisticsInfo"
buttonText:"StatisticsInfo"
(
fn CoordStatistics =
(
try (MaterialName = getRefCoordSys() ) catch(MaterialName = "")
GW.hText [GW.GetWinSizeX()*0.45,30,0] MaterialName color:yellow
gw.updateScreen()
(
fn playAndStopAnimation =
(
if isAnimPlaying() != true do
forcecompleteRedraw doDisabled:true
)
playAndStopAnimation()
)
)
unRegisterRedrawViewsCallback CoordStatistics
registerRedrawViewsCallback CoordStatistics
CoordStatistics ()
--------------------------------------------------------------------------------------------------
fn TransformationsStatistics =
(
try (MaterialName = toolMode.commandmode) catch(MaterialName = "")
GW.hText [GW.GetWinSizeX()*0.35,30,0] MaterialName color:yellow
gw.updateScreen()
)
unRegisterRedrawViewsCallback TransformationsStatistics
registerRedrawViewsCallback TransformationsStatistics
TransformationsStatistics ()
-------------------------------------------------------------------------------------------------
fn SubselectionStatistics =
(
try (MaterialName = $.GetEPolySelLevel()) catch(MaterialName = "")
GW.hText [GW.GetWinSizeX()*0.55,30,0] MaterialName color:yellow
gw.updateScreen()
)
unRegisterRedrawViewsCallback SubselectionStatistics
registerRedrawViewsCallback SubselectionStatistics
SubselectionStatistics ()
--------------------------------------------------------------------------------------------------
fn NameselectionStatistics =
(
try (MaterialName = objName = selection[1].name) catch(MaterialName = "")
GW.hText [GW.GetWinSizeX()*0.65,30,0] MaterialName color:yellow
gw.updateScreen()
)
unRegisterRedrawViewsCallback NameselectionStatistics
registerRedrawViewsCallback NameselectionStatistics
NameselectionStatistics ()
--------------------------------------------------------------------------------------------------
fn meshStatistics =
if(classof (modPanel.getCurrentObject()) == Editable_Mesh) Then
(
SOLevelName = case SubObjectLevel of
(
3: #face
)
try (SOLevelName = SubObjectLevel() ) catch(MaterialName = "")
GW.hText [GW.GetWinSizeX()*0.55,30,0] SOLevelName color:yellow
gw.updateScreen()
)
unRegisterRedrawViewsCallback meshStatistics
registerRedrawViewsCallback meshStatistics
meshStatistics ()
--------------------------------------------------------------------------------------------------
)
Replies
fn vpSelStats_fn = ( vpWidth = gw.getWinSizeX() selType = try(($.baseObject) as string)catch("n/a") SelName = try(($.name) as string)catch("n/a") selMod = try (((modpanel.getCurrentObject()).name) as string)catch("n/a") --Only works if Modifier Tab is active. selSub = try (subobjectLevel as string)catch("n/a") allInfo = ("Type: " + selType + " | ") + ("Name: " + SelName + " | ") + ("Modifier: " + selMod + " | ") + ("Sub Object Level: " + selSub) viewCenterX = (vpWidth / 2) - (((gw.getTextExtent allInfo).x) / 2) gw.setTransform (Matrix3 1) gw.wtext [viewCenterX,30,0] allInfo color:Yellow gw.UpdateScreen() ) if (vpSelStatsState == undefined or vpSelStatsState == "Off") then ( registerRedrawViewsCallback vpSelStats_fn global vpSelStatsState = "On" ) else ( UnregisterRedrawViewsCallback vpSelStats_fn vpSelStatsState = "Off" ) redrawViews<br>