WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Help simple addon (https://www.wowinterface.com/forums/showthread.php?t=55811)

Samshad 10-19-17 10:06 AM

Help simple addon
 
Hello,

I would like to create an addon that displays an image for a few seconds after the death of a boss, but I can not figure out how to display an image, can you help me? Thanks !

Fizzlemizz 10-19-17 11:29 AM

Lua Code:
  1. local frame = CreateFrame("Frame", nil, UIParent)
  2. frame:SetSize(20, 20)
  3. frame.Texture = frame:CreateTexture()
  4. frame.Texture:SetAllPoints()
  5. frame.Texture:SetTexture("Interface/Addons/YourAddon/YourImageFile")
  6. frame:SetPoint("CENTER")

frame:Show() or frame:Hide() to show/hide as required

Kakjens 10-19-17 11:46 AM

Some trivial suggestions:
1. Formalizing what you mean by "boss". Only raid bosses? Or dungeon bosses as well? What about faction leaders? Or some gnoll leader ir Redridge Mountains? There are cases when multiple boss-level enemies get defeated within one encounter. One example of such encounter is Iron Council in Ulduar, when bosses need to be defeated sequentially. There's also Illidari Council in Black Temple, where bosses share the same health. And there are bosses which need to be defeated within the same time window, like Conclave of Winds in Throne of the Four Winds.
2. So your task has three parts: understanding when to display (using WoW events), making a frame visible for some time(frame API (creation, changing their visibility) and timers), and changing displayed image of frame(frame API). But for all of that there will be need at least some knowledge of lua.
So I fear this simple add-on might require non-trivial amount of coding.

Samshad 10-19-17 11:56 AM

Thanks Fizzlemizz :) The image has to be a .blp right ?
Kakjens, thanks for your answer, I already found the right wow event : ENCOUNTER_END

Fizzlemizz 10-19-17 12:02 PM

The image can be .blp or .tga. The edges must be a power of 2 in length (2, 4, 8, 16, 32, 64 etc.). It must have an alpha channel (ifyou use Gimp you can create an image with a transparent background and save to .tga using the default settings).

Samshad 10-19-17 12:10 PM

Thank you, it works perfectly!


All times are GMT -6. The time now is 02:37 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI