• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

TasFullScreenFrame

A small system that can help with custom UI. It creates Frames that can leave the 4:3 screen, by using them as parent or anchor it might become easier. Has a vjass & Lua version. Works in Warcraft 3 V1.31.1 and V1.36.

When this system creates its Frames, it uses one of these as parent ("ConsoleUIBackdrop", 0) > ("Multiboard", 0) > ("Leaderboard", 0) > make a new unseeable Leaderboard.
It uses what it can find. The one it uses needs to be kept visible.
When it uses ("ConsoleUIBackdrop", 0) the Layer it starts is rendered below SimpleFrames, the background textures, hero buttons etc. "ConsoleUIBackdrop" does not exist in Warcraft 3 V1.31.1
While ("Multiboard", 0) & ("Leaderboard", 0) starts a Layer above SimpleFrames. Although SimpleFrames will have a higher interaction prio. If you create&show another Multiboard/Leaderboard it will hide the previous one. Then if such was used as Parent of TasFullScreenParent it will hide it and all that children/offspring of TasFullScreenParent.

I suggest to create Layers/Frames ontop of TasFullScreenParent. something like InGameParent & PopUpParent. That way you can hide/show all your custom ui with one set-visible call. But one should not target TasFullScreenParent because then one can't use the widescreen feature anymore as the Parent/Elders need to be visible. Therefore I suggest this additonal Frames ontop of the FullScreenFrame.
Everything that is just there during normal gameplay goes into the Layer started by CustomInGameUIParent.
PopUpParent would hold custom UI that should be above all your others but still below something like EscMenu (F10)

CustomInGameUIParent = BlzCreateFrameByType("FRAME", "CustomInGameUIParent", TasFullScreenParent, "", 0)
CustomPopUpParent = BlzCreateFrameByType("FRAME", "CustomPopUpParent", TasFullScreenParent, "", 0)

Lua:
--[[ TasFullScreenFrame V2 by Tasyen
This helps in creating Frames that can Leave 4:3 of Screen and helps in attaching to the left/right border of the window. Works in Warcraft 3 V1.31.1 and V1.36.

Creates 2 Frames TasFullScreenFrame & TasFullScreenParent.
TasFullScreenFrame can be used as relative Frame in BlzFrameSetPoint. It can not be a parent as it is hidden.
TasFullScreenParent is used as parent in CreateFrame to make your Frames able to leave 4:3. Do not use it for SimpleFrames.
TasFullScreenParentScaled like TasFullScreenParent but scales with UI scale option.

when Leaderboard/Multiboard are the anchestor, then they need to be visible otherwise your frames will not be visible. They can be hidden when your frame shows&creates Leaderboard/Multiboard after TasFullScreenFrameInit run.
Multiboard is used when there already exists a Multiboard when TasFullScreenFrameInit runs.

credits Niklas, ScrewTheTrees

Example
function Test()
    local frame = BlzCreateFrame("ScriptDialogButton", TasFullScreenParent, 0, 0)
    BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0, 0.3)

    frame = BlzCreateFrame("ScriptDialogButton", TasFullScreenParentScaled, 0, 0)
    BlzFrameSetPoint(frame, FRAMEPOINT_TOPLEFT, TasFullScreenFrame, FRAMEPOINT_LEFT, 0, 0.10)
end
]]
do
    local AutoRun = false --(true) will create Itself at 0s, (false) you need to TasFullScreenFrameInit()
    local UpdateRate = 0.5 -- How fast to update the size of TasFullScreenFrame
    local lastXSize = 0
    -- provides the parent that can Leave 4:3 and with that our frames
    local function GetParent()
        -- try to use "ConsoleUIBackdrop" can not happen in V1.31.1
        local parent = BlzGetFrameByName("ConsoleUIBackdrop", 0)
        if GetHandleId(parent) > 0 then return parent end

        -- ConsoleUIBackdrop failed, therefore use a Multiboard
        parent = BlzGetFrameByName("Multiboard", 0)
        if GetHandleId(parent) > 0 then return parent end

        -- Multiboard failed, therefore use a Leaderboard
        -- try attaching to a existing one
        parent = BlzGetFrameByName("Leaderboard", 0)
        if GetHandleId(parent) > 0 then return parent end

        -- create a Leaderboard and make it not seeable
        CreateLeaderboardBJ(bj_FORCE_ALL_PLAYERS, "title")
        parent = BlzGetFrameByName("Leaderboard", 0)
        BlzFrameSetSize(parent, 0, 0)
        BlzFrameSetVisible(BlzGetFrameByName("LeaderboardBackdrop", 0), false)
        BlzFrameSetVisible(BlzGetFrameByName("LeaderboardTitle", 0), false)
        return parent
    end

    local function Update()
        -- update the full screen frame to current Resolution
        local y = BlzGetLocalClientHeight()
        if y ~= 0 then
            BlzFrameSetSize(TasFullScreenFrame, BlzGetLocalClientWidth()/y*0.6, 0.6)
        end
        local newSize = BlzFrameGetWidth(BlzGetFrameByName("ConsoleUIBackdrop", 0))
        if newSize ~= lastXSize then
            lastXSize = newSize
            BlzFrameSetScale(TasFullScreenParent, 1)
            BlzFrameSetScale(TasFullScreenParentScaled, newSize/0.8)
        end
    end
    
    local function InitFrames()
        -- Make the TasFullScreenFrames
        -- to allow TasFullScreenParent to expand over 4:3 it needs a Parent that can do such GetParent() gives us that one
        BlzGetFrameByName("ConsoleUIBackdrop", 0)
        local parent = GetParent()
        local frame = BlzCreateFrameByType("FRAME", "TasFullScreenParent", parent, "", 0)
        TasFullScreenParent = frame
        TasFullScreenParentScaled = BlzCreateFrameByType("FRAME", "TasFullScreenParentScaled", parent, "", 0)	    
        BlzFrameSetScale(TasFullScreenParent, 1)

        -- Lets make another Frame which size is the whole screen
        -- it is hidden to not take control and dont have visuals.
        -- as child of TasFullScreenParent it can expand outside of 4:3
        frame = BlzCreateFrameByType("FRAME", "TasFullScreenFrame", frame, "", 0)
        BlzFrameSetVisible(frame, false)
        BlzFrameSetSize(frame, 0.8, 0.6)
        BlzFrameSetAbsPoint(frame, FRAMEPOINT_BOTTOM, 0.4, 0)
        TasFullScreenFrame = frame
    end

    -- this would be an outside thing that calls the others
    function TasFullScreenFrameInit()
        InitFrames()
        if FrameLoaderAdd then FrameLoaderAdd(InitFrames) end
        TimerStart(CreateTimer(), UpdateRate, true, Update)
    end
    if AutoRun then
        if OnInit then -- Total Initialization v5.2.0.1 by Bribe
            OnInit.final("TasFullScreenFrame", TasFullScreenFrameInit)
        else -- without
            local real = MarkGameStarted
            function MarkGameStarted()
                real()
                TasFullScreenFrameInit()
            end
        end
    end
end

JASS:
library TasFullScreenFrame initializer Init
/* TasFullScreenFrame V2 by Tasyen
This helps in creating Frames that can Leave 4:3 of Screen and helps in attaching to the left/right border of the window. Works in Warcraft 3 V1.31.1 and V1.36.

Creates 2 Frames TasFullScreenFrame & TasFullScreenParent.
TasFullScreenFrame can be used as relative Frame in BlzFrameSetPoint. It can not be a parent as it is hidden.
TasFullScreenParent is used as parent in CreateFrame to make your Frames able to leave 4:3. Do not use it for SimpleFrames.
TasFullScreenParentScaled like TasFullScreenParent but scales with UI scale option.

when Leaderboard/Multiboard are the anchestor, then they need to be visible otherwise your frames will not be visible. They can be hidden when your frame shows&creates Leaderboard/Multiboard after TasFullScreenFrameInit run.
Multiboard is used when there already exists a Multiboard when TasFullScreenFrameInit runs.

credits Niklas, ScrewTheTrees

Example
function Test takes nothing returns nothing
    local framehandle frame = BlzCreateFrame("ScriptDialogButton", TasFullScreenParent, 0, 0)
    call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0, 0.3)

    set frame = BlzCreateFrame("ScriptDialogButton", TasFullScreenParentScaled, 0, 0)
    call BlzFrameSetPoint(frame, FRAMEPOINT_TOPLEFT, TasFullScreenFrame, FRAMEPOINT_LEFT, 0, 0.10)
endfunction
*/
globals
    framehandle TasFullScreenParent = null
    framehandle TasFullScreenParentScaled = null
    framehandle TasFullScreenFrame = null
    public boolean AutoRun = true //(true) will create Itself at 0s, (false) you need to TasFullScreenFrameInit()
    public real UpdateRate = 0.5 // How fast to update the size of TasFullScreenFrame
    public real lastXSize = 0.0
endglobals
    // provides the parent that can Leave 4:3 and with that our frames
    public function GetParent takes nothing returns framehandle
        // try to use "ConsoleUIBackdrop" can not happen in V1.31.1
        local framehandle parent = BlzGetFrameByName("ConsoleUIBackdrop", 0)
        if GetHandleId(parent) > 0 then
         return parent
        endif

        // ConsoleUIBackdrop failed, therefore use a Multiboard
        set parent = BlzGetFrameByName("Multiboard", 0)
        if GetHandleId(parent) > 0 then
         return parent 
        endif

        // Multiboard failed, therefore use a Leaderboard
        // try attaching to a existing one
        set parent = BlzGetFrameByName("Leaderboard", 0)
        if GetHandleId(parent) > 0 then
         return parent
         endif

        // create a Leaderboard and make it not seeable
        call CreateLeaderboardBJ(bj_FORCE_ALL_PLAYERS, "title")
        set parent = BlzGetFrameByName("Leaderboard", 0)
        call BlzFrameSetSize(parent, 0, 0)
        call BlzFrameSetVisible(BlzGetFrameByName("LeaderboardBackdrop", 0), false)
        call BlzFrameSetVisible(BlzGetFrameByName("LeaderboardTitle", 0), false)
        return parent
    endfunction

    public function Update takes nothing returns nothing
        // update the full screen frame to current Resolution
        local real y = BlzGetLocalClientHeight()
        if y != 0 then
            call BlzFrameSetSize(TasFullScreenFrame, BlzGetLocalClientWidth()/y*0.6, 0.6)
        endif
        set y = BlzFrameGetWidth(BlzGetFrameByName("ConsoleUIBackdrop", 0))
        if y != lastXSize then
            set lastXSize = y
            call BlzFrameSetScale(TasFullScreenParent, 1)
            call BlzFrameSetScale(TasFullScreenParentScaled, y/0.8)
        endif
    endfunction
    
    public function InitFrames takes nothing returns nothing
        // Make the TasFullScreenFrames
        // to allow TasFullScreenParent to expand over 4:3 it needs a Parent that can do such GetParent() gives us that one
        local framehandle parent = GetParent()
        call BlzGetFrameByName("ConsoleUIBackdrop", 0)

	    set TasFullScreenParent = BlzCreateFrameByType("FRAME", "TasFullScreenParent", parent, "", 0)
        set TasFullScreenParentScaled = BlzCreateFrameByType("FRAME", "TasFullScreenParentScaled", parent, "", 0)

        call BlzFrameSetScale(TasFullScreenParent, 1)

        // Lets make another Frame which size is the whole screen
        // it is hidden to not take control and dont have visuals.
        // as child of TasFullScreenParent it can expand outside of 4:3
        set TasFullScreenFrame = BlzCreateFrameByType("FRAME", "TasFullScreenFrame", TasFullScreenParent, "", 0)
        call BlzFrameSetVisible(TasFullScreenFrame, false)
        call BlzFrameSetSize(TasFullScreenFrame, 0.8, 0.6)
        call BlzFrameSetAbsPoint(TasFullScreenFrame, FRAMEPOINT_BOTTOM, 0.4, 0)
    endfunction

    // this would be an outside thing that calls the others
    function TasFullScreenFrameInit  takes nothing returns nothing
        local timer t = GetExpiredTimer()
        if t == null then
             set t = CreateTimer()
        endif
        call InitFrames()
        static if LIBRARY_FrameLoader then
            call FrameLoaderAdd(function InitFrames)
        endif
        
        call TimerStart(t, UpdateRate, true, function Update)
    endfunction
    public function Init takes nothing returns nothing
        if AutoRun then
            call TimerStart(CreateTimer(), 0.01, false, function TasFullScreenFrameInit)
        endif
    endfunction    
endlibrary

V2) added TasFullScreenParentScaled, TasFullScreenParent unaffected by UI scale options

Tags: Custom UI, 4:3, WideScreen, 16:9
Contents

TasFullScreenFrame.Lua (Binary)

TasFullScreenFrame.vjass (Binary)

Reviews
Antares
A good dependency standard for UI resources to enable frames in the widescreen area. Unlike a simple ConsoleUIBackdrop as the parent, this resource allows compatibility with 1.31. Approved
Level 8
Joined
Oct 20, 2010
Messages
213
I would love to use this system. But, for the life of me, I cannot figure out how to implement it. I am using another system of yours (TasWindowTab) and would appreciate being shown how to modify this code to allow me to place it outside of the normal area.

EDIT: Resolved. Thank you, great system, just had to fiddle around until I figured out what I was missing!

 
Last edited:
For anyone still curious one uses TasFullScreenParent as parent/owner when creating the frame like shown in the commented example

Lua:
--Example
function Test()
    local frame = BlzCreateFrame("ScriptDialogButton", TasFullScreenParent, 0, 0)
    BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOP, 0, 0.3)

    frame = BlzCreateFrame("ScriptDialogButton", TasFullScreenParent, 0, 0)
    BlzFrameSetPoint(frame, FRAMEPOINT_TOPLEFT, TasFullScreenFrame, FRAMEPOINT_LEFT, 0, 0.10)
end

In case of TasWindowTab, you would create the TasWindow with TasFullScreenParent as parent/owner or a child of TasFullScreenParent.
The Tabs become children of TasWindow anyway, One could create the frame added as child of windowTable.WindowPane then one avoids the bugs of parentship change (sprite, highlight as far I know).
Lua:
CustomInGameUIParent = BlzCreateFrameByType("FRAME", "CustomInGameUIParent", FullScreenParent, "", 0)
TasUnitHoverInfo = TasWindow.create("Unit Hover Info", false, 0, CustomInGameUIParent)
 
Last edited:
Top