Multiple images in frame
Hello guys,
from little experiences I have build this: Code:
MapQuestIconFrame = CreateFrame("Button", "TextureBasics") And Im looking for a way to place multiple images inside this frame based on coordinates. can you guide me how? Thank you |
I'm not exactly sure what you're asking. Can you elaborate more on what you're trying to do?
There are also a few things I want to point out. You're creating a button and storing it in MapQuestIconFrame, but are giving it the name TextureBasics, which also stores it in that global. Why not skip assigning the global and just name it MapQuestIconFrame? When you call WorldMapFrame:SetScript(), you're breaking WorldMapFrame by replacing any existing function there. Use WorldMapFrame:HookScript() instead. Every time MapQuestIconShow() is called, you're running MapQuestIconFrame:CreateTexture(), which keeps creating a new UI object every time you open WorldMapFrame. |
I'm not exactly sure what you're asking. Can you elaborate more on what you're trying to do?
- basicaly every time I open the map is to populate it with icons based on some logis statement, and when closing the map remove all of them, because everytime I open the map, the amount and positions (and overall settings) of those icons will be different, thats why its better OnHide() of worldmap to always delete them all, and create new ones on OnShow() You're creating a button and storing it in MapQuestIconFrame, but are giving it the name TextureBasics, which also stores it in that global. Why not skip assigning the global and just name it MapQuestIconFrame? - yes, sorry this was my mistake, Button was an error, it should be just Frame When you call WorldMapFrame:SetScript(), you're breaking WorldMapFrame by replacing any existing function there. Use WorldMapFrame:HookScript() instead. - I was not aware im breaking it the original script, so I used HookScript() instead Every time MapQuestIconShow() is called, you're running MapQuestIconFrame:CreateTexture(), which keeps creating a new UI object every time you open WorldMapFrame. - yes, I am not this far, but my ultimate goal is something like this (dont know how to syntax it yet): Code:
MapQuestIconFrame = CreateFrame("Frame", "MapQuestIconFrame") |
Here's my take on it. I would suggest trying to insert custom pins in the MapCanvas system, but I haven't dug around it ever since it was implemented. There isn't a way to delete UI objects without a logout or UI reload, so you have to create a pool of them by storing them in a table you grab from. There's no reason to loop through and hide the icons OnHide. The "cleanup" is handled with the next OnShow.
Lua Code:
|
All times are GMT -6. The time now is 08:17 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI