PlayerModels are the most commonly used subtype of Model frame. They expand on the Model type by adding functions to quickly set the model to represent a particular player or creature, by unitID or creature ID.
These models are used by the stock UI for "paper doll" frames, to display a player's character, minion, vanity pets and mounts. They're also used by unit frame mods, to provide animated portraits or full-body "action figure" displays of characters and monsters.
Defined Methods
- PlayerModel:GetDoBlend() - This function is not yet documented
- PlayerModel:RefreshCamera() - This function is not yet documented
- PlayerModel:RefreshUnit() - Updates the model's appearance to match that of its unit
- PlayerModel:SetAnimation() - This function is not yet documented
- PlayerModel:SetBarberShopAlternateForm() - This function is not yet documented
- PlayerModel:SetCamDistanceScale() - This function is not yet documented
- PlayerModel:SetCreature(creature) - Sets the model to display the 3D model of a specific creature
- PlayerModel:SetCustomRace() - This function is not yet documented
- PlayerModel:SetDisplayInfo() - This function is not yet documented
- PlayerModel:SetDoBlend() - This function is not yet documented
- PlayerModel:SetPortraitZoom() - This function is not yet documented
- PlayerModel:SetRotation(facing) - Sets the model's current rotation by animating the model
- PlayerModel:SetUnit("unit") - Sets the model to display the 3D model of a specific unit
Inherited Methods
- PlayerModel:AdvanceTime() - Advances to the model's next animation frame
- PlayerModel:AllowAttributeChanges() - Temporarily allows insecure code to modify the frame's attributes during combat
- enabled = PlayerModel:CanChangeAttribute() - Returns whether secure frame attributes can currently be changed
- canChange = PlayerModel:CanChangeProtectedState() - Returns whether protected properties of the region can be changed by non-secure scripts
- PlayerModel:ClearAllPoints() - Removes all anchor points from the region
- PlayerModel:ClearFog() - Disables fog display for the model.
- PlayerModel:ClearModel() - Removes the 3D model currently displayed
- animationGroup = PlayerModel:CreateAnimationGroup(["name" [, "inheritsFrom"]]) - Creates a new AnimationGroup as a child of the region
- fontstring = PlayerModel:CreateFontString(["name" [, "layer" [, "inherits"]]]) - Creates a new [[docs/widgets/FontString|`FontString`]] as a child of the frame
- texture = PlayerModel:CreateTexture(["name" [, "layer" [, "inherits" [, sublevel]]]]) - Creates a new [[docs/widgets/Texture|`Texture`]] as a child of the frame
- region = PlayerModel:CreateTitleRegion() - Creates a title region for dragging the frame
- PlayerModel:DisableDrawLayer("layer") - Prevents display of all child objects of the frame on a specified graphics layer
- PlayerModel:EnableDrawLayer("layer") - Allows display of all child objects of the frame on a specified graphics layer
- PlayerModel:EnableJoystick(enable) - Enables or disables joystick interactivity
- PlayerModel:EnableKeyboard(enable) - Enables or disables keyboard interactivity for the frame
- PlayerModel:EnableMouse(enable) - Enables or disables mouse interactivity for the frame
- PlayerModel:EnableMouseWheel(enable) - Enables or disables mouse wheel interactivity for the frame
- alpha = PlayerModel:GetAlpha() - Returns the opacity of the region relative to its parent
- ... = PlayerModel:GetAnimationGroups() - Returns a list of animation groups belonging to the region
- value = PlayerModel:GetAttribute("name") - Returns the value of a secure frame attribute
- backdrop = PlayerModel:GetBackdrop() - Returns information about the frame's backdrop graphic
- red, green, blue, alpha = PlayerModel:GetBackdropBorderColor() - Returns the shading color for the frame's border graphic
- red, green, blue, alpha = PlayerModel:GetBackdropColor() - Returns the shading color for the frame's background graphic
- bottom = PlayerModel:GetBottom() - Returns the distance from the bottom of the screen to the bottom of the region
- left, bottom, width, height = PlayerModel:GetBoundsRect() - Returns the position and dimension of the smallest area enclosing the frame and its children
- PlayerModel:GetCameraDistance() - This function is not yet documented
- PlayerModel:GetCameraFacing() - This function is not yet documented
- PlayerModel:GetCameraPosition() - This function is not yet documented
- PlayerModel:GetCameraTarget() - This function is not yet documented
- x, y = PlayerModel:GetCenter() - Returns the screen coordinates of the region's center
- ... = PlayerModel:GetChildren() - Returns a list of child frames of the frame
- left, right, top, bottom = PlayerModel:GetClampRectInsets() - Returns offsets from the frame's edges used when limiting user movement or resizing of the frame
- depth = PlayerModel:GetDepth() - Returns the 3D depth of the frame (for stereoscopic 3D setups)
- PlayerModel:GetDontSavePosition() - This function is not yet documented
- alpha = PlayerModel:GetEffectiveAlpha() - Returns the overall opacity of the frame
- depth = PlayerModel:GetEffectiveDepth() - Returns the overall 3D depth of the frame (for stereoscopic 3D configurations)
- scale = PlayerModel:GetEffectiveScale() - Returns the overall scale factor of the frame
- facing = PlayerModel:GetFacing() - Returns the model's current rotation setting
- red, green, blue = PlayerModel:GetFogColor() - Returns the model's current fog color
- distance = PlayerModel:GetFogFar() - Returns the far clipping distance for the model's fog.
- distance = PlayerModel:GetFogNear() - Returns the near clipping distance for the model's fog.
- level = PlayerModel:GetFrameLevel() - Sets the level at which the frame is layered relative to others in its strata
- strata = PlayerModel:GetFrameStrata() - Returns the general layering strata of the frame
- height = PlayerModel:GetHeight() - Returns the height of the region
- left, right, top, bottom = PlayerModel:GetHitRectInsets() - Returns the insets from the frame's edges which determine its mouse-interactable area
- id = PlayerModel:GetID() - Returns the frame's numeric identifier
- left = PlayerModel:GetLeft() - Returns the distance from the left edge of the screen to the left edge of the region
- enabled, omni, dirX, dirY, dirZ, ambIntensity, ambR, ambG, ambB, dirIntensity, dirR, dirG, dirB = PlayerModel:GetLight() - Returns properties of the light sources used when rendering the model
- maxWidth, maxHeight = PlayerModel:GetMaxResize() - Returns the maximum size of the frame for user resizing
- minWidth, minHeight = PlayerModel:GetMinResize() - Returns the minimum size of the frame for user resizing
- filename = PlayerModel:GetModel() - Returns the model file currently displayed
- scale = PlayerModel:GetModelScale() - Returns the scale factor determining the size at which the 3D model appears
- name = PlayerModel:GetName() - Returns the widget object's name
- numChildren = PlayerModel:GetNumChildren() - Returns the number of child frames belonging to the frame
- numPoints = PlayerModel:GetNumPoints() - Returns the number of anchor points defined for the region
- numRegions = PlayerModel:GetNumRegions() - Returns the number of non-Frame child regions belonging to the frame
- type = PlayerModel:GetObjectType() - Returns the object's widget type
- parent = PlayerModel:GetParent() - Returns the object's parent object
- point, relativeTo, relativePoint, xOffset, yOffset = PlayerModel:GetPoint(index) - Returns information about one of the region's anchor points
- x, y, z = PlayerModel:GetPosition() - Returns the position of the 3D model within the frame
- PlayerModel:GetPropagateKeyboardInput() - This function is not yet documented
- left, bottom, width, height = PlayerModel:GetRect() - Returns the position and dimensions of the region
- ... = PlayerModel:GetRegions() - Returns a list of non-Frame child regions belonging to the frame
- right = PlayerModel:GetRight() - Returns the distance from the left edge of the screen to the right edge of the region
- scale = PlayerModel:GetScale() - Returns the frame's scale factor
- handler = PlayerModel:GetScript("scriptType") - Returns the widget's handler function for a script
- width, height = PlayerModel:GetSize() - Returns the width and height of the region
- region = PlayerModel:GetTitleRegion() - Returns the frame's TitleRegion object
- top = PlayerModel:GetTop() - Returns the distance from the bottom of the screen to the top of the region
- width = PlayerModel:GetWidth() - Returns the width of the region
- PlayerModel:GetWorldScale() - This function is not yet documented
- PlayerModel:HasCustomCamera() - This function is not yet documented
- hasScript = PlayerModel:HasScript("scriptType") - Returns whether the widget supports a script handler
- PlayerModel:Hide() - Hides the region
- PlayerModel:HookScript("scriptType", handler) - Securely hooks a script handler
- PlayerModel:IgnoreDepth(enable) - Sets whether the frame's depth property is ignored (for stereoscopic 3D setups)
- enabled = PlayerModel:IsClampedToScreen() - Returns whether the frame's boundaries are limited to those of the screen
- isDragging = PlayerModel:IsDragging() - Returns whether the region is currently being dragged
- registered = PlayerModel:IsEventRegistered("event") - Returns whether the frame is registered for a given [[docs/events|event]]
- enabled = PlayerModel:IsIgnoringDepth() - Returns whether the frame's depth property is ignored (for stereoscopic 3D setups)
- enabled = PlayerModel:IsJoystickEnabled() - Returns whether joystick interactivity is enabled for the frame
- enabled = PlayerModel:IsKeyboardEnabled() - Returns whether keyboard interactivity is enabled for the frame
- enabled = PlayerModel:IsMouseEnabled() - Returns whether mouse interactivity is enabled for the frame
- isOver = PlayerModel:IsMouseOver([topOffset [, leftOffset [, bottomOffset [, rightOffset]]]]) - Returns whether the mouse cursor is over the given region
- enabled = PlayerModel:IsMouseWheelEnabled() - Returns whether mouse wheel interactivity is enabled for the frame
- movable = PlayerModel:IsMovable() - Returns whether the frame can be moved by the user
- isType = PlayerModel:IsObjectType("type") - Returns whether the object belongs to a given widget type
- isProtected, explicit = PlayerModel:IsProtected() - Returns whether the region is protected
- enabled = PlayerModel:IsResizable() - Returns whether the frame can be resized by the user
- shown = PlayerModel:IsShown() - Returns whether the region is shown
- enabled = PlayerModel:IsToplevel() - Returns whether the frame is automatically raised to the front when clicked
- enabled = PlayerModel:IsUserPlaced() - Returns whether the frame is flagged for automatic saving and restoration of position and dimensions
- visible = PlayerModel:IsVisible() - Returns whether the region is visible
- PlayerModel:Lower() - Reduces the frame's frame level below all other frames in its strata
- PlayerModel:Raise() - Increases the frame's frame level above all other frames in its strata
- PlayerModel:RegisterAllEvents() - Registers the frame for all events
- PlayerModel:RegisterEvent("event") - Registers the frame for an [[docs/events|event]]
- PlayerModel:RegisterForDrag(...) - Registers the frame for dragging
- PlayerModel:RegisterUnitEvent() - This function is not yet documented
- PlayerModel:ReplaceIconTexture("filename") - Sets the icon texture used by the model
- PlayerModel:SetAllPoints([region]) or PlayerModel:SetAllPoints(["name"]) - Sets all anchor points of the region to match those of another region
- PlayerModel:SetAlpha(alpha) - Sets the opacity of the region relative to its parent
- PlayerModel:SetAttribute("name", value) - Sets a secure frame attribute
- PlayerModel:SetBackdrop(backdrop) - Sets a backdrop graphic for the frame
- PlayerModel:SetBackdropBorderColor(red, green, blue [, alpha]) - Sets a shading color for the frame's border graphic
- PlayerModel:SetBackdropColor(red, green, blue [, alpha]) - Sets a shading color for the frame's background graphic
- PlayerModel:SetCamera(index) - Sets the view angle on the model to a pre-defined camera location
- PlayerModel:SetCameraDistance() - This function is not yet documented
- PlayerModel:SetCameraFacing() - This function is not yet documented
- PlayerModel:SetCameraPosition() - This function is not yet documented
- PlayerModel:SetCameraTarget() - This function is not yet documented
- PlayerModel:SetClampRectInsets(left, right, top, bottom) - Sets offsets from the frame's edges used when limiting user movement or resizing of the frame
- PlayerModel:SetClampedToScreen(enable) - Sets whether the frame's boundaries should be limited to those of the screen
- PlayerModel:SetCustomCamera() - This function is not yet documented
- PlayerModel:SetDepth(depth) - Sets the 3D depth of the frame (for stereoscopic 3D configurations)
- PlayerModel:SetDontSavePosition() - This function is not yet documented
- PlayerModel:SetFacing(facing) - Sets the model's current rotation
- PlayerModel:SetFogColor(red, green, blue) - Sets the model's fog color, enabling fog display if disabled
- PlayerModel:SetFogFar(distance) - Sets the far clipping distance for the model's fog.
- PlayerModel:SetFogNear(distance) - Sets the near clipping distance for the model's fog.
- PlayerModel:SetFrameLevel(level) - Sets the level at which the frame is layered relative to others in its strata
- PlayerModel:SetFrameStrata("strata") - Sets the general layering strata of the frame
- PlayerModel:SetGlow(amount) - Sets the model's glow amount
- PlayerModel:SetHeight(height) - Sets the region's height
- PlayerModel:SetHitRectInsets(left, right, top, bottom) - Sets the insets from the frame's edges which determine its mouse-interactable area
- PlayerModel:SetID(id) - Sets a numeric identifier for the frame
- PlayerModel:SetLight(enabled, omni, dirX, dirY, dirZ, ambIntensity [, ambR [, ambG [, ambB [, dirIntensity [, dirR [, dirG [, dirB]]]]]]]) - Sets properties of the light sources used when rendering the model
- PlayerModel:SetMaxResize(maxWidth, maxHeight) - Sets the maximum size of the frame for user resizing
- PlayerModel:SetMinResize(minWidth, minHeight) - Sets the minimum size of the frame for user resizing
- PlayerModel:SetModel("filename") - Sets the model file to be displayed
- PlayerModel:SetModelScale(scale) - Sets the scale factor determining the size at which the 3D model appears
- PlayerModel:SetMovable(enable) - Sets whether the frame can be moved by the user
- PlayerModel:SetParent(frame) or PlayerModel:SetParent("name") - Makes another frame the parent of this region
- PlayerModel:SetPoint("point" [, relativeTo [, "relativePoint" [, xOffset [, yOffset]]]]) - Sets an anchor point for the region
- PlayerModel:SetPosition(x, y, z) - Sets the position of the 3D model within the frame
- PlayerModel:SetPropagateKeyboardInput() - This function is not yet documented
- PlayerModel:SetResizable(enable) - Sets whether the frame can be resized by the user
- PlayerModel:SetScale(scale) - Sets the frame's scale factor
- PlayerModel:SetScript("scriptType", handler) - Sets the widget's handler function for a script
- PlayerModel:SetSequence(sequence) - Sets the animation sequence to be used by the model
- PlayerModel:SetSequenceTime(sequence, time) - Sets the animation sequence and time index to be used by the model
- PlayerModel:SetShown() - This function is not yet documented
- PlayerModel:SetSize(width, height) - Sets the size of the region to the specified values
- PlayerModel:SetToplevel(enable) - Sets whether the frame should automatically come to the front when clicked
- PlayerModel:SetUserPlaced(enable) - Flags the frame for automatic saving and restoration of position and dimensions
- PlayerModel:SetWidth(width) - Sets the region's width
- PlayerModel:Show() - Shows the region
- PlayerModel:StartMoving() - Begins repositioning the frame via mouse movement
- PlayerModel:StartSizing() - Begins resizing the frame via mouse movement
- PlayerModel:StopAnimating() - Stops any active animations involving the region or its children
- PlayerModel:StopMovingOrSizing() - Ends movement or resizing of the frame initiated with [[docs/widgets/Frame/StartMoving|`:StartMoving()`]] or [[docs/widgets/Frame/StartSizing|`:StartSizing()`]]
- PlayerModel:UnregisterAllEvents() - Unregisters the frame from any [[docs/events|events]] for which it is registered
- PlayerModel:UnregisterEvent("event") - Unregisters the frame for an event
Script Handlers
- OnAnimFinished(self) - Run when the model's animation finishes
- OnAttributeChanged(self, "name", value) - Run when a frame attribute is changed
- OnChar(self, "text") - Run for each text character typed in the frame
- OnDisable(self) - Run when the frame is disabled
- OnDragStart(self, "button") - Run when the mouse is dragged starting in the frame
- OnDragStop(self) - Run when the mouse button is released after a drag started in the frame
- OnEnable(self) - Run when the frame is enabled
- OnEnter(self, motion) - Run when the mouse cursor enters the frame's interactive area
- OnEvent(self, "event", ...) - Run whenever an [[docs/events|event]] fires for which the frame is registered
- OnHide(self) - Run when the frame's visbility changes to hidden
- OnKeyDown(self, "key") - Run when a keyboard key is pressed if the frame is keyboard enabled
- OnKeyUp(self, "key") - Run when a keyboard key is released if the frame is keyboard enabled
- OnLeave(self, motion) - Run when the mouse cursor leaves the frame's interactive area
- OnLoad(self) - Run when the frame is created
- OnMouseDown(self, "button") - Run when a mouse button is pressed while the cursor is over the frame
- OnMouseUp(self, "button") - Run when the mouse button is released following a mouse down action in the frame
- OnMouseWheel(self, delta) - Run when the frame receives a mouse wheel scrolling action
- OnReceiveDrag(self) - Run when the mouse button is released after dragging into the frame
- OnShow(self) - Run when the frame becomes visible
- OnSizeChanged(self, width, height) - Run when a frame's size changes
- OnUpdate(self, elapsed) - Run each time the screen is drawn by the game engine
- OnUpdateModel(self) - Run when a model changes or animates