Wowpedia
Advertisement
Wowpedia
240,483
pages

Positions a model relative to the bottom-left corner.

model:SetPosition(x, y, z)

Arguments

number - Positive values moves the model right; negative left.
number - Positive values moves the model up, negative down.
number - Positive values moves the model nearer; negative further away.

Details

The bottom left corner of the Model frame will always have coordinates (0,0,0). However, the top right corner's coordinate depends upon the width and height of the Model frame, and the screen resolution returned by GetScreenWidth/GetScreenHeight.

The following script calculates these top and right edges:

local scale = UIParent:GetEffectiveScale();
local hypotenuse = ( ( GetScreenWidth() * scale ) ^ 2 + ( GetScreenHeight() * scale ) ^ 2 ) ^ 0.5;
 
local coordRight = ( model:GetRight() - model:GetLeft() ) / hypotenuse; -- X
local coordTop = ( model:GetTop() - model:GetBottom() ) / hypotenuse; -- Y
Advertisement