Classic Addon Questions
So i've been trying to import 3d models by myself since weakauras classic no longer has the feature, and I'm speficially looking to have either movable (and lockable) or pre-positioned 3d models of my target and my player character loaded behind my player and target unitframes. I have loaded the player/target models no problem, but as far as i'm aware they aren't being updated, so the target only appears when I manually run the script in-game when targetting something. On to the questions:
1. How can I make my player model update when I change gear, or even change animations in a combat event? 2. How can I make my target model update when I switch targets, or disappear when I have no target? bonus points: Is there anyway to cutoff the model at the waist, so only the top half of my character is displayed above the unitframe? If you have any suggestions on how I could answer some of these questions, I'd love to hear them. I am new to programming altogether so I may ask for clarification!! Thanks!! |
I forgot to include what I have so far, here it is!
local model = CreateFrame("PlayerModel", nil, UIParent) model:SetSize(150, 200) model:SetPoint("CENTER", UIParent, "CENTER", 0, 0) model:SetUnit("player") model:SetCamera(2) model:SetFacing(30) model:RefreshCamera() model:Show() local model = CreateFrame("PlayerModel", nil, UIParent) model:SetSize(150, 200) model:SetPoint("CENTER", UIParent, "CENTER", 0, 0) model:SetUnit("target") model:SetCamera(2) model:RefreshCamera() model:Show() |
Something like:
Lua Code:
You can use the model:SetPortraitZoom() and SetPosition() methods zoom/move the model within the frame. |
Quote:
Oh my god! Fizzlemizz, you are seriously my inspiration for addon dev to begin with!! I’ve been using DUF for a lot of my UI projects for such a long time. I honestly couldn’t have asked for a better response from a better person. To be honest, I thought about reaching out to you with my questions but I didn’t want to bother you. Thanks so much for taking the time to reply. I’ll hit the drawing board with this new info, thanks a ton! |
All times are GMT -6. The time now is 05:40 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI