# Wait For Portrait To Load
Grammar — Wait for portrait to finish loading
Flags —Native
|Action
Waits until the specified portrait is finished loading. This may be necessary before some operations may be applied to the portrait.
# Arguments
int
<portrait> — Portrait
Returns — void
native void PortraitWaitForLoad(int p);
# Related
Category: Portrait / Advanced
- Destroy All Portraits —
void
— PortraitDestroyAll - Destroy Portrait —
void
— PortraitDestroy - Play Portrait Animation —
void
— libNtve_gf_PortraitSetAnim - Set Portrait Camera —
void
— PortraitSetCamera - Set Portrait Border Texture —
void
— PortraitSetBorderTexture - Set Portrait Light —
void
— PortraitSetLight - Set Portrait Model —
void
— PortraitSetModel - Set Portrait Model And Play Animation —
void
— PortraitSetModelAnim - Set Portrait Position —
void
— PortraitSetPosition - Set Portrait Size —
void
— PortraitSetSize - Set Portrait Transition Model —
void
— PortraitSetTransitionModel - Set Portrait Mouse Target —
void
— PortraitSetMouseTarget - Set Portrait Channel —
void
— PortraitSetChannel - Set Portrait Render Type —
void
— PortraitSetRenderType - Mute/Unmute Portrait —
void
— PortraitSetMuted - Pause/Unpause Portrait —
void
— PortraitSetPaused - Set Portrait Tint Color —
void
— PortraitSetTintColor - Set Portrait Team Color —
void
— PortraitSetTeamColor - Set Portrait Actor —
void
— PortraitSetActor - Turn Portrait Border On/Off —
void
— PortraitSetBorderVisible - Turn Portrait Background On/Off —
void
— PortraitSetBackgroundVisible - Turn Portrait Fullscreen On/Off —
void
— PortraitSetFullscreen - Turn Portrait Offscreen On/Off —
void
— PortraitSetOffscreen - Turn Portrait Transition On/Off —
void
— PortraitUseTransition - Force Portrait Transition On/Off —
void
— PortraitForceTransition - Clear Portrait Animation —
void
— libNtve_gf_ClearPortraitAnimation - Wait For Portrait To Load —
void
— PortraitWaitForLoad
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:13540
PortraitSetBackgroundVisible(PortraitLastCreated(), false);
PortraitSetBorderVisible(PortraitLastCreated(), false);
PortraitWaitForLoad(PortraitLastCreated());
PortraitSetVisible(PortraitLastCreated(), PlayerGroupAll(), true, true);
gf_GoToRoom(ge_RoomID_RoomVoid, false);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:26539
gv_bridgeCommunicatorPortraitValerian = PortraitLastCreated();
PortraitSetOffscreen(gv_bridgeCommunicatorPortraitValerian, true);
PortraitWaitForLoad(gv_bridgeCommunicatorPortraitValerian);
PortraitSetVisible(gv_bridgeCommunicatorPortraitValerian, PlayerGroupAll(), true, true);
PortraitSetChannel(gv_bridgeCommunicatorPortraitValerian, 1);
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:29970
gf_ResetActorToLocation(ge_ActorID_ActorHorner, PointFromId(678));
gf_ResetActorToLocation(ge_ActorID_ActorRaynor, PointFromId(680));
PortraitWaitForLoad(lv_portaitMiddlePlanet);
ActorSend(ActorFromPortrait(lv_portaitMiddlePlanet), "AnimPlay Default Stand PlayForever");
ActorSend(ActorFromPortrait(lv_portaitMiddlePlanet), "AnimSetTimeScale Default 5.000000");
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tzeratul02.sc2map/MapScript.galaxy:7132
PortraitCreate(0, 0, c_anchorCenter, 237, 360, "VC_Zeratul2_Planet", "", "", false, false);
gv_victoryCinematicPortrait = PortraitLastCreated();
PortraitWaitForLoad(PortraitLastCreated());
PortraitSetFullscreen(PortraitLastCreated(), true);
PortraitSetLight(PortraitLastCreated(), "VC_Zeratul2_Planet");
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:13540
PortraitSetBackgroundVisible(PortraitLastCreated(), false);
PortraitSetBorderVisible(PortraitLastCreated(), false);
PortraitWaitForLoad(PortraitLastCreated());
PortraitSetVisible(PortraitLastCreated(), PlayerGroupAll(), true, true);
gf_GoToRoom(ge_RoomID_RoomVoid, false);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:26539
gv_bridgeCommunicatorPortraitValerian = PortraitLastCreated();
PortraitSetOffscreen(gv_bridgeCommunicatorPortraitValerian, true);
PortraitWaitForLoad(gv_bridgeCommunicatorPortraitValerian);
PortraitSetVisible(gv_bridgeCommunicatorPortraitValerian, PlayerGroupAll(), true, true);
PortraitSetChannel(gv_bridgeCommunicatorPortraitValerian, 1);
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:29970
gf_ResetActorToLocation(ge_ActorID_ActorHorner, PointFromId(678));
gf_ResetActorToLocation(ge_ActorID_ActorRaynor, PointFromId(680));
PortraitWaitForLoad(lv_portaitMiddlePlanet);
ActorSend(ActorFromPortrait(lv_portaitMiddlePlanet), "AnimPlay Default Stand PlayForever");
ActorSend(ActorFromPortrait(lv_portaitMiddlePlanet), "AnimSetTimeScale Default 5.000000");
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tzeratul02.sc2map — MapScript.galaxy:7132
PortraitCreate(0, 0, c_anchorCenter, 237, 360, "VC_Zeratul2_Planet", "", "", false, false);
gv_victoryCinematicPortrait = PortraitLastCreated();
PortraitWaitForLoad(PortraitLastCreated());
PortraitSetFullscreen(PortraitLastCreated(), true);
PortraitSetLight(PortraitLastCreated(), "VC_Zeratul2_Planet");
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:1507
PortraitSetBorderVisible(libSwaC_gv_zS_PlanetPortrait, false);
PortraitUseTransition(PortraitLastCreated(), false);
PortraitWaitForLoad(libSwaC_gv_zS_PlanetPortrait);
}
else {
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:1389
}
if ((lib281DEC45_gv_zSS_UITravelBGPortrait != c_invalidDialogControlId) && (lib281DEC45_gv_zSS_UITravelSelectedPlanet != 0) && (DialogControlIsVisible(lib281DEC45_gv_zSS_UITravelBGPortrait, 1) == true)) {
PortraitWaitForLoad(PortraitGetTriggerControl(lib281DEC45_gv_zSS_UITravelBGPortrait));
}
else {
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:1394
}
if ((lib281DEC45_gv_zSS_UITravelSelectedPlanet != 0) && (DialogControlIsVisible(lib281DEC45_gv_zSS_UITravelContactPortrait, 1) == true)) {
PortraitWaitForLoad(PortraitGetTriggerControl(lib281DEC45_gv_zSS_UITravelContactPortrait));
}
else {
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:1686
// Implementation
PortraitSetModel(PortraitGetTriggerControl(lib281DEC45_gv_zSS_MissionContactPortrait), (lib281DEC45_gf_ZSS_UIMissionProperty("ContactModelLink")), true);
PortraitWaitForLoad(PortraitGetTriggerControl(lib281DEC45_gv_zSS_MissionContactPortrait));
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignMissionLib.galaxy:2013
PortraitSetBorderVisible(libVCMI_gv_pM_PlanetPortrait, false);
PortraitUseTransition(PortraitLastCreated(), false);
PortraitWaitForLoad(libVCMI_gv_pM_PlanetPortrait);
}
else {
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCMI.galaxy:2693
PortraitSetBorderVisible(libNCMI_gv_NM_PlanetPortrait, false);
PortraitUseTransition(PortraitLastCreated(), false);
PortraitWaitForLoad(libNCMI_gv_NM_PlanetPortrait);
}
else {
mods/voidprologue.sc2mod — base.sc2data/LibA3DDD02B.galaxy:1193
PortraitSetBorderVisible(libA3DDD02B_gv_pP_PlanetPortrait, false);
PortraitUseTransition(PortraitLastCreated(), false);
PortraitWaitForLoad(libA3DDD02B_gv_pP_PlanetPortrait);
}
else {