(9 ratings)
new_Frame = BlzCreateFrameByType("SPRITE", "justAName", frame_owner, "WarCraftIIILogo", 0)
BlzFrameSetPoint(new_Frame, FRAMEPOINT_BOTTOMLEFT, frame_relative, FRAMEPOINT_BOTTOMLEFT, 0.02, 0.02)
BlzFrameSetSize(new_Frame, 1., 1.)
BlzFrameSetScale(new_Frame, 1.)
BlzFrameSetModel(new_Frame, "selecter1.mdx", 0)
use the code that was attachedCan you attach a working example?
I tried, but couldn't get it working. Everything compiled correctly but no sprites showed up on the frames I tried creating them on. That's why seeing how it works on a frame in a map would be nice.use the code that was attached
show me how you are creating themI tried, but couldn't get it working. Everything compiled correctly but no sprites showed up on the frames I tried creating them on. That's why seeing how it works on a frame in a map would be nice.
show me how you are creating them
new_Frame = BlzCreateFrameByType("SPRITE", "justAName", frame_owner, "WarCraftIIILogo", 0)
BlzFrameSetPoint(new_Frame, FRAMEPOINT_BOTTOMLEFT, frame_relative, FRAMEPOINT_BOTTOMLEFT, 0.02, 0.02)
BlzFrameSetSize(new_Frame, 1., 1.)
BlzFrameSetScale(new_Frame, 1.)
BlzFrameSetModel(new_Frame, "selecter1.mdx", 0)
TestFrame = nil
BackdropTestFrame = nil
TriggerTestFrame = nil
REFORGEDUIMAKER = {}
REFORGEDUIMAKER.TestFrameFunc = function()
BlzFrameSetEnable(TestFrame, false)
BlzFrameSetEnable(TestFrame, true)
globals.udg_TestFrame = GetConvertedPlayerId(GetTriggerPlayer())
end
REFORGEDUIMAKER.Initialize = function()
TestFrame = BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
BlzFrameSetAbsPoint(TestFrame, FRAMEPOINT_TOPLEFT, 0.424300, 0.393930)
BlzFrameSetAbsPoint(TestFrame, FRAMEPOINT_BOTTOMRIGHT, 0.458260, 0.362300)
BackdropTestFrame = BlzCreateFrameByType("BACKDROP", "BackdropTestFrame", TestFrame, "", 1)
BlzFrameSetAllPoints(BackdropTestFrame, TestFrame)
BlzFrameSetTexture(BackdropTestFrame, "none.blp", 0, true)
TriggerTestFrame = CreateTrigger()
BlzTriggerRegisterFrameEvent(TriggerTestFrame, TestFrame, FRAMEEVENT_CONTROL_CLICK)
TriggerAddAction(TriggerTestFrame, REFORGEDUIMAKER.TestFrameFunc)
end
i dont see where you are creating it
- Frames Initiate
- Events
- Map initialization
- Conditions
- Actions
- Custom script: REFORGEDUIMAKER.Initialize()
- Custom script: BlzFrameSetVisible(TestFrame, true)
- Custom script: BlzFrameSetVisible(new_Frame, false)
- Click Button
- Events
- Game - TestFrame becomes Equal to 1.00
- Conditions
- Actions
- Game - Display to (All players) the text: Button is Working
- Custom script: BlzFrameSetVisible(new_Frame, true)
- Custom script: BlzFrameSetParent(new_Frame, TestFrame)
Code:new_Frame = BlzCreateFrameByType("SPRITE", "justAName", frame_owner, "WarCraftIIILogo", 0) BlzFrameSetPoint(new_Frame, FRAMEPOINT_BOTTOMLEFT, frame_relative, FRAMEPOINT_BOTTOMLEFT, 0.02, 0.02) BlzFrameSetSize(new_Frame, 1., 1.) BlzFrameSetScale(new_Frame, 1.) BlzFrameSetModel(new_Frame, "selecter1.mdx", 0)
Code:TestFrame = nil BackdropTestFrame = nil TriggerTestFrame = nil REFORGEDUIMAKER = {} REFORGEDUIMAKER.TestFrameFunc = function() BlzFrameSetEnable(TestFrame, false) BlzFrameSetEnable(TestFrame, true) globals.udg_TestFrame = GetConvertedPlayerId(GetTriggerPlayer()) end REFORGEDUIMAKER.Initialize = function() TestFrame = BlzCreateFrame("ScriptDialogButton", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0) BlzFrameSetAbsPoint(TestFrame, FRAMEPOINT_TOPLEFT, 0.424300, 0.393930) BlzFrameSetAbsPoint(TestFrame, FRAMEPOINT_BOTTOMRIGHT, 0.458260, 0.362300) BackdropTestFrame = BlzCreateFrameByType("BACKDROP", "BackdropTestFrame", TestFrame, "", 1) BlzFrameSetAllPoints(BackdropTestFrame, TestFrame) BlzFrameSetTexture(BackdropTestFrame, "none.blp", 0, true) TriggerTestFrame = CreateTrigger() BlzTriggerRegisterFrameEvent(TriggerTestFrame, TestFrame, FRAMEEVENT_CONTROL_CLICK) TriggerAddAction(TriggerTestFrame, REFORGEDUIMAKER.TestFrameFunc) end
You said;i dont see where you are creating it
you can create it properly by using this code
LUA
Code:new_Frame = BlzCreateFrameByType("SPRITE", "justAName", frame_owner, "WarCraftIIILogo", 0) BlzFrameSetPoint(new_Frame, FRAMEPOINT_BOTTOMLEFT, frame_relative, FRAMEPOINT_BOTTOMLEFT, 0.02, 0.02) BlzFrameSetSize(new_Frame, 1., 1.) BlzFrameSetScale(new_Frame, 1.) BlzFrameSetModel(new_Frame, "selecter1.mdx", 0)"
Alright, well, if you're not even gonna try to say anything remotely useful then I guess I'm at a loss. Have a good day.dude.. at least you should learn the basics of lua, you cant just insert bunch of code and expect it to work
Everyone has got to start somewhere, and examining working code is a good way to learn. You'd probably spend way less time pointing me in the right direction rather than dicking around, and it would be a lot more constructive and educational. Instead you chose to spend time on pretentiously replying with useless, short one-liners.or you could just learn how to code to avoid this kind of problem, and honestly, any kind of problem with code
Obviously you're wrong though, since I managed to get it working just fine from doing exactly what I said, inspecting a working example. So the next time I have a problem like this I know what to do, and how to solve it. Nobody "did the whole work for me" like you're suggesting, so stop attributing yourself stuff you didn't do.right direction is to learn how to use code, which really solves any problem with code, it's pretty useless to teach people how to do abstract things when they dont understand the basics, next time they see new piece of code they will be lost once again, until someone do whole work for them, and the circle made full spin
I'll research other methods? This is besides the point.what happens if the thing you want to do has no examples?
This is simply not true, you can learn a lot simply by examining working code. Breaking things down, and taking things apart to learn how they work is not only applicable when learning to code, but when learning pretty much anything.you learn not by examining the code, you learn when you actually write code and algorithms by yourself
Um, yes you do? From examining code I learned that I need to make some form of global initiation for all functions in Lua if I want to call them with custom scripts. Again, see this;because that way you dont learn actually
This is simply not true, you can learn a lot simply by examining working code. Breaking things down, and taking things apart to learn how they work is not only applicable when learning to code, but when learning pretty much anything.
Nice strawman argument there, since I didn't really "mash" pieces together here and there. I carefully read about what natives to use in common.j, used already working frames, and tried implementing your code into an already working environment. From there I took several specific actions to test your code to make it work, including defining parent frames and so on. My mistake was that I assumed all Lua scripts are automatically initialized, but I later came to learn that they in fact need to be manually initialized and called. So after all this I'd say I have a better understanding of how it works and how to solve similar problems in the future.mashing pieces here and there not understanding how it's even working