• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Overlapping portrait frame

Status
Not open for further replies.
Level 4
Joined
Mar 8, 2006
Messages
27
Anyone played with moving around the portrait frame? I can move it no problem, but it seems to overlap with whatever frames are at an equal level or below it. I can put frames over top without any collision, but for whatever reason below doesn't work.

I've played around with `BlzFrameSetLevel`, but haven't been able to cause any changes with that. Not sure if it even does anything.

I've attached an example of what the overlapping looks like against a green backdrop. The green backdrop is a parent frame of the portrait.

Basically the question is if its possible to put stuff underneath the portrait frame without this weird z-index overlap issue.

E.g.:

overlap.PNG

Code:
local originFrame = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
local portraitBackdropFrame = BlzCreateFrameByType(
  "BACKDROP",
  "portraitBackdropFrame",
  originFrame,
  "",
  0
)
BlzFrameSetSize(portraitBackdropFrame, 0.5, 0.5)
BlzFrameSetAbsPoint(portraitBackdropFrame, FRAMEPOINT_CENTER, 0.2, 0.2)

local portraitFrame = BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0)
BlzFrameSetVisible(portraitFrame, true)
BlzFrameClearAllPoints(portraitFrame)
BlzFrameSetAllPoints(portraitFrame, portraitBackdropFrame)

BlzFrameSetParent(portraitFrame, portraitBackdropFrame)
 
I moved it around and placed it above other Frames. But it was a bit clunky for some models, the Goblin shop showed the form of the unit behind the Portrait (a Dragon), the human footman Training Building was almost invisible. But I did not much testing with that Problem.

To Change the Level of the Portrait you have to Change the Level of its parent, after doing that the Portrait can be above other Frames.
JASS:
call BlzFrameSetLevel( BlzFrameGetParent(BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT,0)), 1 or higher)

Edit: You changed the level basicly by Changing the parent, if that was successful.

Although for some reason the glowing behind hero Buttons were also placed above the hero Buttons which makes them very intensive and the Icon less visible (only for the optic).

When the Default UI is not hidden, one has to use call BlzEnableUIAutoPosition( false ) to be able to move the Portrait.


This 2 Images show the Impact of the changed Frame Level

Portait over frames.jpg default Portrait.jpg
 
Level 4
Joined
Mar 8, 2006
Messages
27
> To Change the Level of the Portrait you have to Change the Level of its parent, after doing that the Portrait can be above other Frames.

For anyone possibly coming to this thread, this works. Thanks @Tasyen !
 
Status
Not open for further replies.
Top