[Feature Request] Outline BaseScreenComponent More Options

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
Magicono43
Posts: 1139
Joined: Tue Nov 06, 2018 7:06 am

[Feature Request] Outline BaseScreenComponent More Options

Post by Magicono43 »

So while working on this progress bar feature for one of my mods, the user Reconsile gave me a suggestion to make the bar outlines look smoother instead of straight pointed edges. Currently this is not possible with the current Outline component, so I figure why not suggest maybe this could be added possibly for anyone interested in a little puzzle?

Here are some examples of what they were proposing:
unknown.png
unknown.png (37.99 KiB) Viewed 5603 times
unknown2.png
unknown2.png (108.16 KiB) Viewed 5603 times
If possibly I'll try to take a crack at it, but I honestly don't have much idea how this might be done in this case, but figure I put it out there, thanks.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: [Feature Request] Outline BaseScreenComponent More Options

Post by BadLuckBurt »

Normally you do this with background images. The Outline class doesn't support that (logically as it's only meant to draw an outline) but the Panel class does support textures so maybe that's what you need?
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Magicono43
Posts: 1139
Joined: Tue Nov 06, 2018 7:06 am

Re: [Feature Request] Outline BaseScreenComponent More Options

Post by Magicono43 »

BadLuckBurt wrote: Thu Jul 14, 2022 4:25 am Normally you do this with background images. The Outline class doesn't support that (logically as it's only meant to draw an outline) but the Panel class does support textures so maybe that's what you need?
Yeah that's possible, just sort of liked the idea of being able to do it with Outline which allows you to easily increase or decrease the height and width of the outline, rather than an already drawn texture that is basically static without multiple variants loaded.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: [Feature Request] Outline BaseScreenComponent More Options

Post by BadLuckBurt »

Magicono43 wrote: Thu Jul 14, 2022 11:01 am Yeah that's possible, just sort of liked the idea of being able to do it with Outline which allows you to easily increase or decrease the height and width of the outline, rather than an already drawn texture that is basically static without multiple variants loaded.
Well, the rectangular box should be possible with the Outline class, it lets you specify Thickness up to 16 pixels max.

The Panel class uses partial textures to build the box. The already drawn base texture would be sliced up so you end up with:

Code: Select all

        Texture2D fillBordersTexture;
        Texture2D topBorderTexture, bottomBorderTexture;
        Texture2D leftBorderTexture, rightBorderTexture;
        Texture2D topLeftBorderTexture, topRightBorderTexture;
        Texture2D bottomLeftBorderTexture, bottomRightBorderTexture;
This lets you build a box of arbitrary size, I've done it a tonne for websites. The only tricky thing in your case would be that notch in the middle so I'd drop that.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Magicono43
Posts: 1139
Joined: Tue Nov 06, 2018 7:06 am

Re: [Feature Request] Outline BaseScreenComponent More Options

Post by Magicono43 »

BadLuckBurt wrote: Thu Jul 14, 2022 12:22 pm Well, the rectangular box should be possible with the Outline class, it lets you specify Thickness up to 16 pixels max.

This lets you build a box of arbitrary size, I've done it a tonne for websites. The only tricky thing in your case would be that notch in the middle so I'd drop that.
I guess I should have mentioned that I already have a working version. The more blocky images are not mock-ups but actually rendered in-game, the mock-ups are the ones with the smooth edges.

Currently using a panel to define the place on the screen. Then putting inside that panel an outline for the yellow border parts, and another panel with a background color that is making up the "bar" in this case. I was reading a bit in "Panel.cs" that similar to Outline.cs you can define specific edges you want to draw like top, bottom, left, right, etc.

So I guess in that case you could have panel draw custom textures in those areas of the panel maybe? I'm really not great with texture importing and stuff outside of like one instance I did it to replace the pop-up window for Limited Gold Shops, so not sure how that might be accomplished using panel in this case, even though it seems possibly at a cursory glace.

Not really a big deal to me end of the day, I think the sharp edged rectangles look passable, just would be interesting to have a more "beautified" version if possible.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: [Feature Request] Outline BaseScreenComponent More Options

Post by Interkarma »

The current outline is just a simple rectangle drawer (top, bottom, left, right = outline). Something with nice smooth round edges is possible and might look best done with a shader. I'm not sure off the top of my head the best way to implement this in the current setup, but I'm sure it's possible to do in a really low impact way.

Is this something you want to explore yourself or would like some help with?

User avatar
Magicono43
Posts: 1139
Joined: Tue Nov 06, 2018 7:06 am

Re: [Feature Request] Outline BaseScreenComponent More Options

Post by Magicono43 »

Interkarma wrote: Thu Jul 14, 2022 10:32 pm The current outline is just a simple rectangle drawer (top, bottom, left, right = outline). Something with nice smooth round edges is possible and might look best done with a shader. I'm not sure off the top of my head the best way to implement this in the current setup, but I'm sure it's possible to do in a really low impact way.

Is this something you want to explore yourself or would like some help with?
It's not something of massive necessity for me personally, just that somebody mentioned it to me in PMs and I thought it seemed like a cool idea. If I find some random spark of inspiration on how to do it in a good way I'd likely do it myself similar to the dungeon micro-map thing a week or so ago, but I have doubts on that as I'm not the most clever when it comes to graphical code stuff :P

Post Reply