# Dialog Item Anchor

Grammar — Anchor of dialogItem for player
FlagsNative | Function

Returns the anchor for the specified dialog item in relationship to its parent dialog. Requires a Player parameter as different players may have dialogs set up differently.

# Arguments

  • int<control> — Dialog Item
  • int — Player

Returns — int<preset::Anchor>

native int DialogControlGetAnchor(int control, int player);

Category: Dialog / Dialog Item Size And Position

# Examples

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:1776

    lv_x = IntToFixed(DialogControlGetOffsetX(lp_dialogItem, lp_player));
    if ((DialogControlGetRelativeControl(lp_dialogItem, lp_player) == c_invalidDialogControlId)) {
        lv_anchor = DialogControlGetAnchor(lp_dialogItem, lp_player);
        if (((lv_anchor == c_anchorTopLeft) || (lv_anchor == c_anchorTopRight) || (lv_anchor == c_anchorBottomLeft) || (lv_anchor == c_anchorBottomRight) || (lv_anchor == c_anchorLeft) || (lv_anchor == c_anchorRight))) {
            lv_x -= libCamp_gv_gRIDDLG_MARGINE_X;

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:1797

    lv_y = IntToFixed(DialogControlGetOffsetY(lp_dialogItem, lp_player));
    if ((DialogControlGetRelativeControl(lp_dialogItem, lp_player) == c_invalidDialogControlId)) {
        lv_anchor = DialogControlGetAnchor(lp_dialogItem, lp_player);
        if (((lv_anchor == c_anchorTopLeft) || (lv_anchor == c_anchorTopRight) || (lv_anchor == c_anchorBottomLeft) || (lv_anchor == c_anchorBottomRight) || (lv_anchor == c_anchorTop) || (lv_anchor == c_anchorBottom))) {
            lv_y -= libCamp_gv_gRIDDLG_MARGINE_Y;