# Create Portrait

Grammar — Create a portrait sized (width, height), at position (offsetX|X, offsetY|Y) relative to anchor of screen, and show model model (look from camera camera and play its animation|Default animation) (initially visible|Visible/Hidden) (wait until loaded)
FlagsNative | Action

Creates a portrait on the screen.

# Arguments

  • int — OffsetX
  • int — OffsetY
  • int<preset::Anchor> — Anchor
  • int — Width
  • int — Height
  • string<gamelink::Model> — Model
  • string — Camera
  • string<modelanim> — Animation
  • bool<preset::VisibleHiddenOption> — Visible
  • bool<preset::Trigger_Wait_Option> — Wait For Load

Returns — int<portrait>

native int PortraitCreate(
	int offsetX,
	int offsetY,
	int anchor,
	int width,
	int height,
	string modelLink,
	string cameraLink,
	string animProps,
	bool visible,
	bool waitUntilLoaded,
);

Category: Portrait / Basic

# Examples

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


    gv_zPlanetPanel_Created = true;
    PortraitCreate(0, 0, c_anchorCenter, 237, 360, null, "", "Stand", false, true);
    gv_zPlanetPanel_PortraitPlanet = PortraitLastCreated();
    PortraitSetBackgroundVisible(PortraitLastCreated(), false);

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

    PortraitSetBorderVisible(PortraitLastCreated(), false);
    PortraitSetFullscreen(PortraitLastCreated(), true);
    PortraitCreate(0, 0, c_anchorCenter, 237, 360, "SMZeratulMissionSelectBorder", "", "Stand", false, true);
    gv_zPlanetPanel_PortraitBorder = PortraitLastCreated();
    PortraitSetBackgroundVisible(PortraitLastCreated(), false);

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

    }
    lv_cameraString = lp_camera;
    PortraitCreate(0, 0, c_anchorCenter, lv_width, lv_height, lp_model, lv_cameraString, "Default", true, false);
    PortraitSetOffscreen(PortraitLastCreated(), true);
    if ((lp_attachToScreenNow == true)) {

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

    // Implementation
    if ((lp_mission == libCamp_ge_MapID_MapTZeratul04)) {
        PortraitCreate(0, 0, c_anchorCenter, 237, 360, "SMOvermindBriefingMenu", "", "Stand", false, false);
        GameSetLighting("ZeratulMissionSelectBorder", 0.0);
    }

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

    }
    else {
        PortraitCreate(0, 0, c_anchorCenter, 237, 360, "SMZeratulBriefingBorder", "", "Stand", false, false);
    }
    gv_briefing_TZeratulPortraitZeratul = PortraitLastCreated();

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

    gv_newItems[lv_newItemIndex].lv_label = DialogControlLastCreated();
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "StoryModeNewItemTooltip", PlayerGroupAll());
    PortraitCreate(0, 0, c_anchorTopLeft, FixedToInt(gv_c_NEWITEMINFO_FLASHWIDTH), FixedToInt(gv_c_NEWITEMINFO_FLASHHEIGHT), gv_newItems[lv_newItemIndex].lv_modelFlash, "CameraPortrait", "Default", false, false);
    PortraitUseTransition(PortraitLastCreated(), false);
    gv_newItems[lv_newItemIndex].lv_flash = PortraitLastCreated();

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

    }

    PortraitCreate(0, 0, c_anchorCenter, 450, 450, "ToshPortrait", "Dflt", "", true, true);
    PortraitSetVisible(PortraitLastCreated(), PlayerGroupAll(), true, false);
    Wait(4.0, c_timeReal);

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

    }

    PortraitCreate(0, 0, c_anchorCenter, 450, 450, "HansonPortrait", "Dflt", "", true, true);
    PortraitSetVisible(PortraitLastCreated(), PlayerGroupAll(), true, false);
    Wait(4.0, c_timeReal);

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


    gf_TurnClickablesOnOff(gv_clickables, false);
    PortraitCreate(0, 0, c_anchorCenter, 720, 406, "ValerianPortrait", "", "", false, false);
    gv_bridgeCommunicatorPortraitValerian = PortraitLastCreated();
    PortraitSetOffscreen(gv_bridgeCommunicatorPortraitValerian, true);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttutorial01.sc2map/MapScript.galaxy:1271

    gf_FormatReplayTransmissionButton(gv_replay_Transmission_ButtonID_Main);
    DialogSetVisible(gv_replay_Transmission_Dialog_Main, PlayerGroupAll(), false);
    PortraitCreate(-324, -131, c_anchorCenter, 260, 365, null, "", "", false, true);
    gv_cinematicWindow = PortraitLastCreated();
    PortraitSetBorderVisible(PortraitLastCreated(), false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tzeratul02.sc2map/MapScript.galaxy:7130

    EnvironmentShow(c_environmentTerrain, false);
    GameSetLighting("VC_Zeratul2_Planet", 0.0);
    PortraitCreate(0, 0, c_anchorCenter, 237, 360, "VC_Zeratul2_Planet", "", "", false, false);
    gv_victoryCinematicPortrait = PortraitLastCreated();
    PortraitWaitForLoad(PortraitLastCreated());

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tzeratul04.sc2map/MapScript.galaxy:6717

    EnvironmentShow(c_environmentAll, false);
    GameSetLighting("PlanetViewUlnar", 0.0);
    PortraitCreate(0, 0, c_anchorCenter, 237, 360, "VC_Zeratul4_Fade", "", "", false, true);
    gv_victoryPortrait = PortraitLastCreated();
    PortraitSetLight(gv_victoryPortrait, "PlanetViewUlnar");

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


    gv_zPlanetPanel_Created = true;
    PortraitCreate(0, 0, c_anchorCenter, 237, 360, null, "", "Stand", false, true);
    gv_zPlanetPanel_PortraitPlanet = PortraitLastCreated();
    PortraitSetBackgroundVisible(PortraitLastCreated(), false);

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

    PortraitSetBorderVisible(PortraitLastCreated(), false);
    PortraitSetFullscreen(PortraitLastCreated(), true);
    PortraitCreate(0, 0, c_anchorCenter, 237, 360, "SMZeratulMissionSelectBorder", "", "Stand", false, true);
    gv_zPlanetPanel_PortraitBorder = PortraitLastCreated();
    PortraitSetBackgroundVisible(PortraitLastCreated(), false);

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

    }
    lv_cameraString = lp_camera;
    PortraitCreate(0, 0, c_anchorCenter, lv_width, lv_height, lp_model, lv_cameraString, "Default", true, false);
    PortraitSetOffscreen(PortraitLastCreated(), true);
    if ((lp_attachToScreenNow == true)) {

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

    // Implementation
    if ((lp_mission == libCamp_ge_MapID_MapTZeratul04)) {
        PortraitCreate(0, 0, c_anchorCenter, 237, 360, "SMOvermindBriefingMenu", "", "Stand", false, false);
        GameSetLighting("ZeratulMissionSelectBorder", 0.0);
    }

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

    }
    else {
        PortraitCreate(0, 0, c_anchorCenter, 237, 360, "SMZeratulBriefingBorder", "", "Stand", false, false);
    }
    gv_briefing_TZeratulPortraitZeratul = PortraitLastCreated();

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

    gv_newItems[lv_newItemIndex].lv_label = DialogControlLastCreated();
    libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "StoryModeNewItemTooltip", PlayerGroupAll());
    PortraitCreate(0, 0, c_anchorTopLeft, FixedToInt(gv_c_NEWITEMINFO_FLASHWIDTH), FixedToInt(gv_c_NEWITEMINFO_FLASHHEIGHT), gv_newItems[lv_newItemIndex].lv_modelFlash, "CameraPortrait", "Default", false, false);
    PortraitUseTransition(PortraitLastCreated(), false);
    gv_newItems[lv_newItemIndex].lv_flash = PortraitLastCreated();

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

    }

    PortraitCreate(0, 0, c_anchorCenter, 450, 450, "ToshPortrait", "Dflt", "", true, true);
    PortraitSetVisible(PortraitLastCreated(), PlayerGroupAll(), true, false);
    Wait(4.0, c_timeReal);

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

    }

    PortraitCreate(0, 0, c_anchorCenter, 450, 450, "HansonPortrait", "Dflt", "", true, true);
    PortraitSetVisible(PortraitLastCreated(), PlayerGroupAll(), true, false);
    Wait(4.0, c_timeReal);

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


    gf_TurnClickablesOnOff(gv_clickables, false);
    PortraitCreate(0, 0, c_anchorCenter, 720, 406, "ValerianPortrait", "", "", false, false);
    gv_bridgeCommunicatorPortraitValerian = PortraitLastCreated();
    PortraitSetOffscreen(gv_bridgeCommunicatorPortraitValerian, true);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttutorial01.sc2mapMapScript.galaxy:1271

    gf_FormatReplayTransmissionButton(gv_replay_Transmission_ButtonID_Main);
    DialogSetVisible(gv_replay_Transmission_Dialog_Main, PlayerGroupAll(), false);
    PortraitCreate(-324, -131, c_anchorCenter, 260, 365, null, "", "", false, true);
    gv_cinematicWindow = PortraitLastCreated();
    PortraitSetBorderVisible(PortraitLastCreated(), false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tzeratul02.sc2mapMapScript.galaxy:7130

    EnvironmentShow(c_environmentTerrain, false);
    GameSetLighting("VC_Zeratul2_Planet", 0.0);
    PortraitCreate(0, 0, c_anchorCenter, 237, 360, "VC_Zeratul2_Planet", "", "", false, false);
    gv_victoryCinematicPortrait = PortraitLastCreated();
    PortraitWaitForLoad(PortraitLastCreated());

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tzeratul04.sc2mapMapScript.galaxy:6717

    EnvironmentShow(c_environmentAll, false);
    GameSetLighting("PlanetViewUlnar", 0.0);
    PortraitCreate(0, 0, c_anchorCenter, 237, 360, "VC_Zeratul4_Fade", "", "", false, true);
    gv_victoryPortrait = PortraitLastCreated();
    PortraitSetLight(gv_victoryPortrait, "PlanetViewUlnar");

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

    SoundChannelMute(PlayerGroupAll(), c_soundCategoryDoodad, true);
    if ((libSwaC_gv_zS_PlanetPortrait == c_invalidPortraitId)) {
        PortraitCreate(0, 0, c_anchorTopLeft, 50, 50, lp_model, "", "Default", false, false);
        libSwaC_gv_zS_PlanetPortrait = PortraitLastCreated();
        PortraitSetOffscreen(libSwaC_gv_zS_PlanetPortrait, true);

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

    // Implementation
    if ((libVCMI_gv_pM_PlanetPortrait == c_invalidPortraitId)) {
        PortraitCreate(0, 0, c_anchorTopLeft, 50, 50, lp_model, "", "Default", false, false);
        libVCMI_gv_pM_PlanetPortrait = PortraitLastCreated();
        PortraitSetOffscreen(libVCMI_gv_pM_PlanetPortrait, true);

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:4097

    }

    PortraitCreate(lv_offsetX, lv_offsetY, lv_anchor, lv_width, lv_height, null, "Dflt", "", true, true);
    libNtve_gv_cinematicPortraits[lv_index] = PortraitLastCreated();
    PortraitSetBorderVisible(libNtve_gv_cinematicPortraits[lv_index], true);

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:4147

    }

    PortraitCreate(0, 0, c_anchorCenter, 0, 0, null, "Dflt", "", true, true);
    libNtve_gv_cinematicPortraits[lv_index] = PortraitLastCreated();
    PortraitSetFullscreen(libNtve_gv_cinematicPortraits[lv_index], true);

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3396

    }

    PortraitCreate(lv_offsetX, lv_offsetY, lv_anchor, lv_width, lv_height, null, "Dflt", "", true, true);
    libNtve_gv_cinematicPortraits[lv_index] = PortraitLastCreated();
    PortraitSetBorderVisible(libNtve_gv_cinematicPortraits[lv_index], true);

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:3446

    }

    PortraitCreate(0, 0, c_anchorCenter, 0, 0, null, "Dflt", "", true, true);
    libNtve_gv_cinematicPortraits[lv_index] = PortraitLastCreated();
    PortraitSetFullscreen(libNtve_gv_cinematicPortraits[lv_index], true);

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

    // Implementation
    if ((libNCMI_gv_NM_PlanetPortrait == c_invalidPortraitId)) {
        PortraitCreate(0, 0, c_anchorTopLeft, 50, 50, lp_model, "", "Default", false, false);
        libNCMI_gv_NM_PlanetPortrait = PortraitLastCreated();
        PortraitSetOffscreen(libNCMI_gv_NM_PlanetPortrait, true);

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCST.galaxy:4034


    if ((libNCST_gv_nS_DebugTimeCodeActive == false)) {
        PortraitCreate(50, 0, c_anchorLeft, 237, 360, "DebugModel_TimecodePortrait", "", "Stand", true, true);
        libNCST_gv_nS_DebugTimeCodePortrait = PortraitLastCreated();
        libNCST_gv_nS_DebugTimeCodeActive = true;

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

    SoundChannelMute(PlayerGroupAll(), c_soundCategoryDoodad, true);
    if ((libA3DDD02B_gv_pP_PlanetPortrait == c_invalidPortraitId)) {
        PortraitCreate(0, 0, c_anchorTopLeft, 50, 50, lp_model, "", "Default", false, false);
        libA3DDD02B_gv_pP_PlanetPortrait = PortraitLastCreated();
        PortraitSetOffscreen(libA3DDD02B_gv_pP_PlanetPortrait, true);