更新到0.6.0.2
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
namespace DrawXXL
|
||||
{
|
||||
using UnityEngine;
|
||||
|
||||
[HelpURL("https://www.symphonygames.net/drawxxldocumentation/index.html")]
|
||||
[AddComponentMenu("Xeric Library/DebugDrawLibrary/2D/Text Drawer 2D")]
|
||||
public class TextDrawer2D : TextDrawer
|
||||
{
|
||||
public override void InitializeValues_onceInComponentLifetime()
|
||||
{
|
||||
if (text_exclGlobalMarkupTags == null || text_exclGlobalMarkupTags == "")
|
||||
{
|
||||
text_exclGlobalMarkupTags = "text to draw";
|
||||
text_inclGlobalMarkupTags = "text to draw";
|
||||
}
|
||||
textSection_isOutfolded = true;
|
||||
|
||||
customVector2Configs[0].picker_isOutfolded = false;
|
||||
customVector2Configs[0].source = CustomVector2Source.transformsRight;
|
||||
customVector2Configs[0].clipboardForManualInput = Vector2.right;
|
||||
customVector2Configs[0].vectorInterpretation = VectorInterpretation.globalSpace;
|
||||
}
|
||||
|
||||
public override void DrawVisualizedObject()
|
||||
{
|
||||
CacheSizeScaleFactors("Text Drawer 2D Component");
|
||||
float used_size = Get_used_size();
|
||||
if (text_inclGlobalMarkupTags != null && text_inclGlobalMarkupTags != "")
|
||||
{
|
||||
if (UtilitiesDXXL_Math.ApproximatelyZero(used_size) == false)
|
||||
{
|
||||
GetScaledTextBlockConstraintValues(out float used_forceTextEnlargementToThisMinWidth_value, out float used_forceRestrictTextSizeToThisMaxTextWidth_value, out float used_autoLineBreakWidth_value);
|
||||
Vector2 textDir = Get_customVector2_1_inGlobalSpaceUnits();
|
||||
UtilitiesDXXL_Text.Write2DFramed(text_inclGlobalMarkupTags, GetDrawPos2D_global(), color, used_size, textDir, textAnchor, GetZPos_global_for2D(), enclosingBoxLineStyle, enclosingBox_lineWidth_relToTextSize, enclosingBox_paddingSize_relToTextSize, used_forceTextEnlargementToThisMinWidth_value, used_forceRestrictTextSizeToThisMaxTextWidth_value, used_autoLineBreakWidth_value, autoFlipToPreventMirrorInverted, 0.0f, hiddenByNearerObjects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override float Get_biggestAbsGlobalSizeComponentOfTransform()
|
||||
{
|
||||
return UtilitiesDXXL_Math.GetBiggestAbsComponent_ignoringZ(transform.lossyScale);
|
||||
}
|
||||
|
||||
public override Vector3 Get_used_drawPos3D_global()
|
||||
{
|
||||
return GetDrawPos3D_ofA2DModeTransform_global();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user