# Set Portrait Position

Grammar — Set Portrait position to (OffsetX, OffsetY|OffsetY) related to Anchor
FlagsNative | Action

Sets a portrait’s position on the screen.

# Arguments

  • int<portrait> — Portrait
  • int<preset::Anchor> — Anchor
  • int — OffsetX
  • int — OffsetY

Returns — void

native void PortraitSetPosition(
	int p,
	int anchor,
	int offsetX,
	int offsetY,
);

Category: Portrait / Advanced

# Examples

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

void gf_MoveNewItemFlashInstant (int lp_newItemIndex) {
    // Implementation
    PortraitSetPosition(gv_newItems[lp_newItemIndex].lv_flash, c_anchorTopLeft, 0, (DialogGetOffsetY(gv_newItems[lp_newItemIndex].lv_dialog) + 20));
}

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

void gf_MoveNewItemFlashInstant (int lp_newItemIndex) {
    // Implementation
    PortraitSetPosition(gv_newItems[lp_newItemIndex].lv_flash, c_anchorTopLeft, 0, (DialogGetOffsetY(gv_newItems[lp_newItemIndex].lv_dialog) + 20));
}

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:1563

    GameSetLighting(lv_light, 0.0);
    libSwaC_gv_zS_PlanetPortraitEvoMissionLight = lp_light;
    PortraitSetPosition(libSwaC_gv_zS_PlanetPortrait, c_anchorTopLeft, 0, 0);
    PortraitSetFullscreen(libSwaC_gv_zS_PlanetPortrait, true);
    PortraitSetOffscreen(libSwaC_gv_zS_PlanetPortrait, false);

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:2023

    PortraitSetLight(libVCMI_gv_pM_PlanetPortrait, lp_light);
    GameSetLighting(lp_light, 0.0);
    PortraitSetPosition(libVCMI_gv_pM_PlanetPortrait, c_anchorTopLeft, 0, 0);
    PortraitSetFullscreen(libVCMI_gv_pM_PlanetPortrait, true);
    PortraitSetOffscreen(libVCMI_gv_pM_PlanetPortrait, false);

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCMI.galaxy:2703

    PortraitSetLight(libNCMI_gv_NM_PlanetPortrait, lp_light);
    GameSetLighting(lp_light, 0.0);
    PortraitSetPosition(libNCMI_gv_NM_PlanetPortrait, c_anchorTopLeft, 0, 0);
    PortraitSetFullscreen(libNCMI_gv_NM_PlanetPortrait, true);
    PortraitSetOffscreen(libNCMI_gv_NM_PlanetPortrait, false);

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:1249

    GameSetLighting(lv_light, 0.0);
    libA3DDD02B_gv_pP_PlanetPortraitEvoMissionLight = lp_light;
    PortraitSetPosition(libA3DDD02B_gv_pP_PlanetPortrait, c_anchorTopLeft, 0, 0);
    PortraitSetFullscreen(libA3DDD02B_gv_pP_PlanetPortrait, true);
    PortraitSetOffscreen(libA3DDD02B_gv_pP_PlanetPortrait, false);