1. #1

    Addon - Creating and designing a frame

    I was reading the addon tutorial over at WoWWiki but am still confused about how to make a frame for an addon. As a basic example of what to work with and the options available, I was thinking of just a simple black box, say 50x50 with a small image and some text added to it based on the lua code.

    Any help would be appreciated.
    Author of Instance Profit Tracker
    Find out how much gold you earn soloing raids and dungeons

    Curse | GitHub
    WowInterface

  2. #2
    Go check out "Wow Addon Studio 2010" its got some good features to deal with designing a gui

  3. #3
    Check Treeston's post in this thread:
    -- http://www.mmo-champion.com/threads/...if-possible.#3

    Quote Originally Posted by aidian713 View Post
    Go check out "Wow Addon Studio 2010" its got some good features to deal with designing a gui
    If you are looking for a WYSIWYG editor, I would rather use WoW UI Designer

  4. #4
    I would really rather avoid WYSIWYG, never liked them personally, can usually get a better and faster result by learning the code. Will check out that link, thanks

    -----------------------

    Ah, good old Treeston with his aversion to using XML. If you are reading this Treeston, don't take offense. You are a better addon developer than I will likely ever be and with my last addon you also recommended I drop the XML and do a single LUA file.

    In an ideal situation, my personal preference is to keep the view and event registration in XML, and reserve the LUA for the "business logic" aspect. In all of my coding projects I like to keep GUI and logic separate. Model-View-Controller structure if you are familiar with it. It just makes sense to me to keep them apart. I will be playing around with Treeston's post from that other thread since it is easy to follow and well written, but ideally I would like to learn the XML way to do things.

    OOOHHH! Using an array for loading the ... arguments! I like that a lot better than one, two, three, _, five etc. that all the other examples I have seen used
    Last edited by Arcilux; 2011-08-03 at 12:40 AM.
    Author of Instance Profit Tracker
    Find out how much gold you earn soloing raids and dungeons

    Curse | GitHub
    WowInterface

  5. #5
    Deleted
    Ehh, just looked at the FrameXML for a second and cooked this XML up. No clue if it will actually work.
    Code:
    <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
    ..\FrameXML\UI.xsd">
        <Frame name="SomeFrameName">
            <Size>
                <AbsDimension x="50" y="50"/>
            </Size>
            <Layers>
                <Layer level="BACKGROUND">
                    <Texture file="yourfilepathhere">
                        <Anchors>
                            <Anchor point="TOPLEFT">
                                <Offset>
                                    <AbsDimension x="0" y="0"/>
                                </Offset>
                            </Anchor>
                            <Anchor point="BOTTOMRIGHT">
                                <Offset>
                                    <AbsDimension x="0" y="0"/>
                                </Offset>
                            </Anchor>
                        </Anchors>
                        <Scripts>
                            <OnLoad>
                                self:GetParent().tex = self
                            </OnLoad>
                        </Scripts>
                    </Texture>
                    <FontString inherits="GameFontNormal">
                        <Anchors>
                            <Anchor point="CENTER">
                                <Offset>
                                    <AbsDimension x="0" y="0"/>
                                </Offset>
                            </Anchor>
                        </Anchors>
                        <Scripts>
                            <OnLoad>
                                self:GetParent().text = self
                            </OnLoad>
                        </Scripts>
                    </FontString>
                </Layer>
            </Layers>
            <Anchors>
                <Anchor relativeTo="UIParent" point="CENTER">
                    <Offset>
                        <AbsDimension x="0" y="0"/>
                    </Offset>
                </Anchor>
            </Anchors>
        </Frame>
    </Ui>
    Probably some unneeded stuff there (offsets in particular), but no clue which tags are optional.

    Now if you might excuse me for a moment, because I feel like I'm going to throw up at any moment.

    PS: If you want to keep them separate, make two Lua files. Just do it.

  6. #6
    Quote Originally Posted by Treeston View Post
    Probably some unneeded stuff there (offsets in particular), but no clue which tags are optional.

    Now if you might excuse me for a moment, because I feel like I'm going to throw up at any moment.

    PS: If you want to keep them separate, make two Lua files. Just do it.
    Much appreciated. Will make both a second LUA file and the XML, play with each and decide from there.

    I really don't get your aversion to XML, though. It seems like the tags keep everything neat and clean for graphical aspects, kind of like using PHP for logic (equivalent of LUA) and HTML for display (equivalent of XML)
    Author of Instance Profit Tracker
    Find out how much gold you earn soloing raids and dungeons

    Curse | GitHub
    WowInterface

  7. #7
    Deleted
    I always considered the tags system to be unneeded clutter - I suppose it's up to personal preference, though. Lua is so much shorter in code length and more simple in accessing frames (XML either requires a call with GETGLOBAL or :GetParent() in the OnLoad [I used the second option above] or you have to have every frame take up a separate global namespace key [what the FrameXML templates do]).

  8. #8
    Deleted
    You can either have :SetPoint or you can have <Anchor><all sorts of shit></close it too></Anchor>. Like I said, probably personal preference, though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •