- Joined
- Jul 18, 2010
- Messages
- 2,369
Introduction
Backdrops mange the visual textures of frames, they are borders, backgrounds or images (for non simple frames). Most frames beeing more than simple text have backdrops that manage the textures beeing shown.
BACKDROP can use all the ImageTypes Warcraft 3 supports: BLP, TGA, DDS. DDS can only be used in Warcraft 3 V1.32+. For DDS the compression type matters, in my Test only DXT1/DXT5 worked (generated with GIMP).
BACKDROP can use all the ImageTypes Warcraft 3 supports: BLP, TGA, DDS. DDS can only be used in Warcraft 3 V1.32+. For DDS the compression type matters, in my Test only DXT1/DXT5 worked (generated with GIMP).
Jump to without fdf
BACKDROP FDF
These backdrop childs/subFrame get a stronger connection by declaring them as Control. Such control backdrops mimics the mainFrame in size and position, (if not said otherwise). The 2 most basic controlBackdrops are.
ControlBackdrop <name>,
- <name> is the name of the frame beeing used, it also is most time declared right below the control line. This backdrop is used when the parentFrame is enabled and basicly every Frame has such a thing.
ControlDisabledBackdrop <name>,
- backdrop when the parentFrame is disabled.
Some FrameTypes have more additional controlbackdrops.
What are the Backdrop stats?
Backdrops can not have frameevents.
Backdrops are above simpleframes, hiding them.
name | arguments | info |
DecorateFileNames | Look-Up FileNames in some String table (for example gameinterface) | |
BackdropTileBackground | Fills the Frame with tiles of the texture. Without the background file is stretched | |
BackdropBackgroundSize | 0 to 1.0 | in Tile mode, the size of each tile |
BackdropBackground | FilePath only one "\" | main image |
BackdropBackgroundInsets | real real real real | cuts in the background from the frames outside, granting space between the edge and the background. Right Top Bottom Left. The numbers can be Negative to extend this side over the edge into the outside. |
BackdropCornerFlags | "UL|UR|BL|BR|T|L|B|R" | FRAMEPOINTS having borders (edgefile). Order does not matter |
BackdropCornerSize | 0.0 to 1.0 | size of the border/edge. |
BackdropEdgeFile | FilePath | the border File, this texture having the border as fragments next to each other (gameinterface). You don't need the single ones if you have this one. |
BackdropLeftFile | FilePath | |
BackdropCornerFile | FilePath | |
BackdropTopFile | FilePath | |
BackdropRightFile | FilePath | |
BackdropBottomFile | FilePath | |
BackdropBlendAll | use transparency by alpha channels. An image with alpha channel transparency but without this will look wierd and wrong. It also allows to see the things behind the frame. | |
BackdropHalfSides | ||
BackdropMirrored | vertical, a face looking to the left will look with this option enabled to the right. |
When changing textures with code most of that stuff becomes irrelevant and the backdrop can be empty except for the BackdropBackgroundSize, if one wants tile filling. One changes texture by code with this native.
JASS:
native BlzFrameSetTexture takes framehandle backdrop, string texFile, integer flag, boolean blend returns nothing
- texFile the file one wants to use.
- flag, 0 for stretched mode; 1 for tile mode.
- blend has something to do with transparenz. (false) makes it look wierd, if the texture uses transparenz
Creating just an Icons on the screen doesn't even need a fdf, one can create a BACKDROP using
The Example creating a backdrop with
BlzCreateFrameByType
, afterwards set texture, position and size of that BACKDROP and you have a visible image on the screen. Such a BACKDROP doesn't have a tile mod nor an additional edgefile/border.The Example creating a backdrop with
BlzCreateFrameByType
is from xorkatoss.
JASS:
local framehandle blademaster = BlzCreateFrameByType("BACKDROP", "Blademaster", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
call BlzFrameSetSize(blademaster, 0.04, 0.04)
call BlzFrameSetAbsPoint(blademaster, FRAMEPOINT_CENTER, 0.4, 0.3)
call BlzFrameSetTexture(blademaster, "ReplaceableTextures\\CommandButtons\\BTNHeroBlademaster",0, true)
Example with FDF
This is the text of a custom BACKDROP. In side the fdf there are 2 Frames. "MyBackgroundTile" and "MyBackground".
This jasscode loads the custom toc loading the BACKDROPs in and creates 1 of both after 1 second passed. The tile version is at the left side of the screen. The Big image is at the center of the screen.
The code will not create exactly the following images cause it is recreation, but the will look quite similar.
Changelog:
Code:
Frame "BACKDROP" "MyBackdropTile" {
//DecorateFileNames,
BackdropTileBackground, //Fills the space with the background texture
BackdropBackground "ReplaceableTextures\CommandButtons\BTNHeroPaladin.blp",
BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R",
BackdropCornerSize 0.0125,
BackdropBackgroundSize 0.02, //in tile mode, size of each tile
BackdropBackgroundInsets 0.005 0.005 0.005 0.005,
BackdropEdgeFile "UI\Widgets\ToolTips\Human\human-tooltip-border.blp",
}
Frame "BACKDROP" "MyBackdrop" {
BackdropBackground "ReplaceableTextures\CommandButtons\BTNHeroPaladin.blp",
BackdropCornerFlags "UL|UR|BL|BR|T|L|B|R",
BackdropCornerSize 0.0125,
BackdropBackgroundInsets 0.005 0.005 0.005 0.005,
BackdropEdgeFile "UI\Widgets\ToolTips\Human\human-tooltip-border.blp",
}
JASS:
function CreateBackdrops takes nothing returns nothing
//Create the big face
local framehandle fh = BlzCreateFrame("MyBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0, 0)
call BlzFrameSetSize(fh, 0.1, 0.1)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 0.4, 0.3)
//Create the tile faces
set fh = BlzCreateFrame("MyBackdropTile", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0, 0)
call BlzFrameSetSize(fh, 0.1, 0.1)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 0.2, 0.3)
endfunction
//===========================================================================
function InitTrig_Backdrop takes nothing returns nothing
set gg_trg_Backdrop = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Backdrop, 1.00 )
call TriggerAddAction( gg_trg_Backdrop, function CreateBackdrops )
call LoadToc("war3mapimported\\mybackdrop.toc") //Loads the custom toc file
endfunction
Changelog:
added missing statements to the table.
added a GoTo no Fdf, colored the Headlines and some formating.
added a GoTo no Fdf, colored the Headlines and some formating.
Other UI-Frame Tutorials
The following links might provide more insight into this subject.
UI: Change Lumber Text
[JASS/AI] - UI: Create a TextButton
[JASS/AI] - UI: Positionate Frames (important)
UI: toc-Files
UI: Reading a FDF
UI - The concept of Parent-Frames
[JASS/AI] - UI: FrameEvents and FrameTypes
UI: Frames and Tooltips
[JASS/AI] - UI: Creating a Bar
UI - Simpleframes
UI: What are BACKDROPs?
UI: GLUEBUTTON
UI: TEXTAREA the scrolling Text Frame
UI: EditBox - Text Input
[JASS/AI] - UI: Creating a Cam control
UI: Showing 3 Multiboards
UI: OriginFrames
Default Names for BlzGetFrameByName (Access to Existing game-Frames)
[JASS/AI] - UI: List - Default MainFrames (built in CreateAble)
UI: Change Lumber Text
[JASS/AI] - UI: Create a TextButton
[JASS/AI] - UI: Positionate Frames (important)
UI: toc-Files
UI: Reading a FDF
UI - The concept of Parent-Frames
[JASS/AI] - UI: FrameEvents and FrameTypes
UI: Frames and Tooltips
[JASS/AI] - UI: Creating a Bar
UI - Simpleframes
UI: What are BACKDROPs?
UI: GLUEBUTTON
UI: TEXTAREA the scrolling Text Frame
UI: EditBox - Text Input
[JASS/AI] - UI: Creating a Cam control
UI: Showing 3 Multiboards
UI: OriginFrames
Default Names for BlzGetFrameByName (Access to Existing game-Frames)
[JASS/AI] - UI: List - Default MainFrames (built in CreateAble)
Attachments
Last edited by a moderator: