# Anchor Dialog To Unit

Grammar — Move dialog to (offsetX, offsetY) relative to attachment of unit anchored anchor
FlagsNative | Action

Moves a dialog to the specified anchor, relative to the specified attachment point of the specified unit, with the specified offsets.

# Arguments

  • int<dialog> — Dialog
  • unit — Unit
  • string<preset::AttachPoints> — Attachment
  • int<preset::Anchor> — Anchor
  • int — OffsetX
  • int — OffsetY

Returns — void

native void DialogSetPositionRelativeToUnitWithAnchor(
	int dialog,
	unit inUnit,
	string inAttachment,
	int anchor,
	int offsetX,
	int offsetY,
);

Category: Dialog / Dialog Size And Position

# Examples

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:1141

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:1191

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:1241

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:1291

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:1343

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:1394

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/sc2tutorial.sc2map/MapScript.galaxy:1444

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/paiur01.sc2map/MapScript.galaxy:2091

        lv_textTagDialogAnchor = DialogLastCreated();
        DialogSetImageVisible(lv_textTagDialogAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(lv_textTagDialogAnchor, lv_attackBeacon, "Ref_Origin", c_anchorCenter, 0, 80);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/paiur02.sc2map/MapScript.galaxy:1589

            gv_blinkTagAnchor = DialogLastCreated();
            DialogSetImageVisible(gv_blinkTagAnchor, false);
            DialogSetPositionRelativeToUnitWithAnchor(gv_blinkTagAnchor, gv_blinkHelper, "Ref_Origin", c_anchorCenter, 0, 0);
            DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
            DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/paiur02.sc2map/MapScript.galaxy:2332

            gv_tTextTagAnchor = DialogLastCreated();
            DialogSetImageVisible(gv_tTextTagAnchor, false);
            DialogSetPositionRelativeToUnitWithAnchor(gv_tTextTagAnchor, gv_tInvisHelper, "Ref_Origin", c_anchorCenter, 0, 0);
            DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
            DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/paiur02.sc2map/MapScript.galaxy:3020

            gv_tTextTagAnchor = DialogLastCreated();
            DialogSetImageVisible(gv_tTextTagAnchor, false);
            DialogSetPositionRelativeToUnitWithAnchor(gv_tTextTagAnchor, gv_tInvisHelper, "Ref_Origin", c_anchorCenter, 0, 120);
            DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
            DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/paiur02.sc2map/MapScript.galaxy:3365

            gv_tTextTagAnchor = DialogLastCreated();
            DialogSetImageVisible(gv_tTextTagAnchor, false);
            DialogSetPositionRelativeToUnitWithAnchor(gv_tTextTagAnchor, gv_tMakeAssimilatorAssimilator, "Ref_Origin", c_anchorCenter, 0, 120);
            DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
            DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:1141

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:1191

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:1241

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:1291

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:1343

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:1394

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/sc2tutorial.sc2mapMapScript.galaxy:1444

        gv_textTagAnchor = DialogLastCreated();
        DialogSetImageVisible(gv_textTagAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(gv_textTagAnchor, lp_unit, "Ref_Origin", c_anchorCenter, 0, lp_yOffset);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur01.sc2mapMapScript.galaxy:2091

        lv_textTagDialogAnchor = DialogLastCreated();
        DialogSetImageVisible(lv_textTagDialogAnchor, false);
        DialogSetPositionRelativeToUnitWithAnchor(lv_textTagDialogAnchor, lv_attackBeacon, "Ref_Origin", c_anchorCenter, 0, 80);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur02.sc2mapMapScript.galaxy:1589

            gv_blinkTagAnchor = DialogLastCreated();
            DialogSetImageVisible(gv_blinkTagAnchor, false);
            DialogSetPositionRelativeToUnitWithAnchor(gv_blinkTagAnchor, gv_blinkHelper, "Ref_Origin", c_anchorCenter, 0, 0);
            DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
            DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur02.sc2mapMapScript.galaxy:2332

            gv_tTextTagAnchor = DialogLastCreated();
            DialogSetImageVisible(gv_tTextTagAnchor, false);
            DialogSetPositionRelativeToUnitWithAnchor(gv_tTextTagAnchor, gv_tInvisHelper, "Ref_Origin", c_anchorCenter, 0, 0);
            DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
            DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur02.sc2mapMapScript.galaxy:3020

            gv_tTextTagAnchor = DialogLastCreated();
            DialogSetImageVisible(gv_tTextTagAnchor, false);
            DialogSetPositionRelativeToUnitWithAnchor(gv_tTextTagAnchor, gv_tInvisHelper, "Ref_Origin", c_anchorCenter, 0, 120);
            DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
            DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/paiur02.sc2mapMapScript.galaxy:3365

            gv_tTextTagAnchor = DialogLastCreated();
            DialogSetImageVisible(gv_tTextTagAnchor, false);
            DialogSetPositionRelativeToUnitWithAnchor(gv_tTextTagAnchor, gv_tMakeAssimilatorAssimilator, "Ref_Origin", c_anchorCenter, 0, 120);
            DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
            DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 1, 1);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/MapMechanicsLib.galaxy:711

    DialogCreate(1, 1, c_anchorTop, 0, 0, true);
    libMapM_gv_uIJungleCampPanel.lv_jungleCreepCampsDialog[lp_camp] = DialogLastCreated();
    DialogSetPositionRelativeToUnitWithAnchor(DialogLastCreated(), libMapM_gv_jungleCreepCamps[lp_camp].lv_campOwnershipFlagUnit, "Ref_Overhead", c_anchorCenter, 0, 0);
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
    libMapM_gv_uIJungleCampPanel.lv_jungleCreepCamp_PositionControl[lp_camp] = DialogControlLastCreated();

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/MapMechanicsLib.galaxy:1306

    DialogCreate(1, 1, c_anchorTop, 0, 0, true);
    libMapM_gv_uIJungleCampPanel.lv_jungleCreepCampsDialog[lp_Camp] = DialogLastCreated();
    DialogSetPositionRelativeToUnitWithAnchor(DialogLastCreated(), libMapM_gv_jungleCreepCamps[lp_Camp].lv_campOwnershipFlagUnit, "Ref_Overhead", c_anchorCenter, 0, 0);
    DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
    libMapM_gv_uIJungleCampPanel.lv_jungleCreepCamp_PositionControl[lp_Camp] = DialogControlLastCreated();

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:1113

        DialogCreate(1, 1, c_anchorTop, 0, 0, true);
        libUIUI_gv_uIBoosts.lv_boostFXAnchor[lp_player][lv_heroIndex] = DialogLastCreated();
        DialogSetPositionRelativeToUnitWithAnchor(DialogLastCreated(), lp_heroUnit, "Ref_Overhead", c_anchorBottom, 0, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        libUIUI_gv_uIBoosts.lv_boostFXAnchorFrame[lp_player][lv_heroIndex] = DialogControlLastCreated();

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:1141

        DialogCreate(1, 1, c_anchorTop, 0, 0, true);
        libUIUI_gv_uIBoosts.lv_boostFXAnchor[lp_player][lv_heroIndex] = DialogLastCreated();
        DialogSetPositionRelativeToUnitWithAnchor(DialogLastCreated(), libGDHL_gv_chogallPairs[libGame_gf_TeamNumberOfPlayer(lv_choPlayer)].lv_choUnit, "Ref_Overhead", c_anchorBottom, 0, 0);
        DialogControlCreate(DialogLastCreated(), c_triggerControlTypePanel);
        libUIUI_gv_uIBoosts.lv_boostFXAnchorFrame[lp_player][lv_heroIndex] = DialogControlLastCreated();