# Attach Text Tag To Unit Attach Point

Grammar — Attach tag|Text Tag to unit at attachment point with offset (offsetX, offsetY).
FlagsNative | Action

Attaches a text tag to one of the unit’s attachment points, this can also include an offset.

# Arguments

  • int<preset::TextTag> — Tag
  • unit — Unit
  • string<preset::AttachPoints> — Attachment
  • int — OffsetX
  • int — OffsetY

Returns — void

native void TextTagAttachToUnitPoint(
	int inTag,
	unit inUnit,
	string attachmentPoint,
	int offsetX,
	int offsetY,
);

Category: Text Tag / Basic

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:2882

        TextTagSetAlignment(TextTagLastCreated(), c_alignCenter, c_alignTop);
        TextTagSetTextAlignment(TextTagLastCreated(), c_alignLeft, c_alignTop);
        TextTagAttachToUnitPoint(TextTagLastCreated(), gv_jukeboxes[lp_jukeboxID].lv_box, "Ref_StatusBar", 127, -290);
    }
    else if (auto2FB17D52_val == gv_cantinaJukeboxID) {

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:2888

        TextTagSetAlignment(TextTagLastCreated(), c_alignCenter, c_alignTop);
        TextTagSetTextAlignment(TextTagLastCreated(), c_alignLeft, c_alignTop);
        TextTagAttachToUnitPoint(TextTagLastCreated(), gv_jukeboxes[lp_jukeboxID].lv_box, "Ref_StatusBar", 25, -8);
    }
    else {

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:9560

    TextTagSetBackgroundImage(TextTagLastCreated(), "Assets\\Textures\\blank.dds", true);
    TextTagSetBackgroundBorderSize(TextTagLastCreated(), 0.0, 0.0);
    TextTagAttachToUnitPoint(TextTagLastCreated(), lp_unit, lp_attachmentPoint, lp_offsetX, lp_offsetY);
    TextTagShowBackground(TextTagLastCreated(), true);
    TextTagSetEdgeImage(TextTagLastCreated(), lp_edge, lp_edgeImage, lp_edgeOffsetX, lp_edgeOffsetY);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:30082

    TextTagSetBackgroundBorderSize(TextTagLastCreated(), 0.0, 0.0);
    TextTagSetAlignment(TextTagLastCreated(), c_alignLeft, c_alignBottom);
    TextTagAttachToUnitPoint(TextTagLastCreated(), gf_BriefingScreen(ge_RoomID_RoomBridge, ge_BriefingScreen_Center), "Ref_StatusBar", 0, -60);
    TextTagShowBackground(TextTagLastCreated(), false);
    TextTagSetTime(TextTagLastCreated(), c_textTagTimeDuration, 10.0);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:2882

        TextTagSetAlignment(TextTagLastCreated(), c_alignCenter, c_alignTop);
        TextTagSetTextAlignment(TextTagLastCreated(), c_alignLeft, c_alignTop);
        TextTagAttachToUnitPoint(TextTagLastCreated(), gv_jukeboxes[lp_jukeboxID].lv_box, "Ref_StatusBar", 127, -290);
    }
    else if (auto2FB17D52_val == gv_cantinaJukeboxID) {

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:2888

        TextTagSetAlignment(TextTagLastCreated(), c_alignCenter, c_alignTop);
        TextTagSetTextAlignment(TextTagLastCreated(), c_alignLeft, c_alignTop);
        TextTagAttachToUnitPoint(TextTagLastCreated(), gv_jukeboxes[lp_jukeboxID].lv_box, "Ref_StatusBar", 25, -8);
    }
    else {

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:9560

    TextTagSetBackgroundImage(TextTagLastCreated(), "Assets\\Textures\\blank.dds", true);
    TextTagSetBackgroundBorderSize(TextTagLastCreated(), 0.0, 0.0);
    TextTagAttachToUnitPoint(TextTagLastCreated(), lp_unit, lp_attachmentPoint, lp_offsetX, lp_offsetY);
    TextTagShowBackground(TextTagLastCreated(), true);
    TextTagSetEdgeImage(TextTagLastCreated(), lp_edge, lp_edgeImage, lp_edgeOffsetX, lp_edgeOffsetY);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:30082

    TextTagSetBackgroundBorderSize(TextTagLastCreated(), 0.0, 0.0);
    TextTagSetAlignment(TextTagLastCreated(), c_alignLeft, c_alignBottom);
    TextTagAttachToUnitPoint(TextTagLastCreated(), gf_BriefingScreen(ge_RoomID_RoomBridge, ge_BriefingScreen_Center), "Ref_StatusBar", 0, -60);
    TextTagShowBackground(TextTagLastCreated(), false);
    TextTagSetTime(TextTagLastCreated(), c_textTagTimeDuration, 10.0);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/sc2epilogue03.sc2map/MapScript.galaxy:1682


    libVCMI_gf_AttachReticleEffectAndTextTagOnUnit(libVCMI_ge_CampaginReticleType_ProtossEnemy, libVCMI_ge_CampaginReticleSize_Large, StringExternal("Param/Value/D0F114C5"), lp_targetUnit, "Ref_Center");
    TextTagAttachToUnitPoint(TextTagLastCreated(), lp_targetUnit, "Ref_Center", 0, 0);
    UISetButtonHighlighted(PlayerGroupAll(), AbilityCommand("KerriganEpilogue03QuantumRay", 0), true);
    gv_quantumRayUsed = false;

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/sc2epilogue03.sc2mapMapScript.galaxy:1682


    libVCMI_gf_AttachReticleEffectAndTextTagOnUnit(libVCMI_ge_CampaginReticleType_ProtossEnemy, libVCMI_ge_CampaginReticleSize_Large, StringExternal("Param/Value/D0F114C5"), lp_targetUnit, "Ref_Center");
    TextTagAttachToUnitPoint(TextTagLastCreated(), lp_targetUnit, "Ref_Center", 0, 0);
    UISetButtonHighlighted(PlayerGroupAll(), AbilityCommand("KerriganEpilogue03QuantumRay", 0), true);
    gv_quantumRayUsed = false;