LemonUIbyLemon / LemonUI

LemonUI for .NET (FiveM, RageMP, RagePluginHook and ScriptHookVDotNet 3)
MIT License
177 stars 39 forks source link

Banner Images not Aligning with Menu #185

Open JohnFromGWN opened 1 month ago

JohnFromGWN commented 1 month ago

This is minor issue but a PITA. My LemonUI menu consists of 6 independent menus (and a placeholder) that are perfectly aligned without any gaps. The width and positions are constant. I added banner images with exactly the same width but there is a visible gap between images. In the video below, you can see blue vertical lines where the sky background bleeds through.

https://www.youtube.com/watch?v=J_xlCskzzwQ

JohnFromGWN commented 1 month ago

Actually this shows menu in action

https://www.youtube.com/watch?v=iafq3COB_7o

justalemon commented 1 month ago

That's very weird.

Can you draw them 1 px to the left?

JohnFromGWN commented 1 month ago

That's very weird.

Can you draw them 1 px to the left?

Hi and thank you for the quick response. I've tried moving the banner (please verify my code) and also resizing images. They were cropped and sliced in Photoshop and the dimensions are correct. I normatlly use .Empty, but this time: private static readonly NativeMenu Menu2 = new NativeMenu("", "", "", new ScaledTexture(new PointF(-1, 0), new SizeF(BannerHeight, menuWidth), "JC", "S2")); No luck It's not a huge issue but I wish there was a workaround.

justalemon commented 1 month ago

Ill need to take a deep look at it.

For now, you could draw a solid color in the background.

JohnFromGWN commented 1 month ago

Ill need to take a deep look at it.

For now, you could draw a solid color in the background.

Thanks. That's much appreciated. I tried several workarounds, including replacing the menu slices by one full size image (and removing all the other images). However this failed as the image was constrained to first menu's banner...no overflow.

As for drawing a solid rectangle background, the transparent areas will let the background bleed through. For example a red background will create red lines etc.

It is frustrating however, because i''ve completed my menu framework and a new teleport framework that renders a camera view just before the teleport. Anyway, I have plenty of work now creating the teleports to dozens of locations.

On one final note, I did blow up a screenshot and it confirmed that the menus themselves are perfectly aligned against each other. The gaps only exist with the banners although your conventional single menu with one banner image at 512 x 128 doesn't display any noticeable issues.

Sorry for pushing the envelope...but that's what i try to do....don't like sheep :)

JohnFromGWN commented 1 month ago

OMFG. Lemon, I have to apologize...profusely. This was entirely my mistake. I'll explain the issue. When I adjusted my menu size I found, at least initially, that 135 looked good. So my slices were 135 x 128. When imported into OpenIV they were displayed as 136 x 128 and I remember, oh right, they need to be powers of 2. Ofc when I set up the banners I also wrongly assumed that setting any dimension would just fill up the banner...wrong.

Anyway, the only solution I hadn't tried was to reslice properly and honestly I didn't think it would be the solution. It was.

So please close this and again, please accept my apologies for "the sky is falling down"

https://i.ibb.co/ZdQF6cx/20240807143914-1.jpg

Image is not seamless, but that's a slicing issue, nothing to do with LemoUI. The pics are perfectly aligned.