A_OverlayPivot Screen Coordinates flag

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
kevansevans
Spotlight Team
Posts: 420
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support
Contact:

A_OverlayPivot Screen Coordinates flag

Post by kevansevans »

Suggestion to make the WX/WY coordinates arguments of A_OverlayPivot to be interpreted as screen coordinates instead of offsets relative to the sprite being rotated, similar to how with HudMessage, x and y of 0.5 means to display the message to the center of the viewers monitor.

This would be tremendously useful for having multiple sprites of varying sizes that already have their offsets defined without rotation, but need to be overlayed on the hud with rotation. I have an example here: https://imgur.com/a/8NsIL7s where I need multiple overlays, but due to the different sizes between sprites, they look like they're erratically jumping, and quite frankly it's been a tremendous headache trying to solve for the needed pivot points I need this to work. If I could set this flag, and then set the values to (0.5, 0.5), this could tell the engine to pivot them around the center of the screen, instead around the sprites center.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: A_OverlayPivot Screen Coordinates flag

Post by Major Cooke »

It's one of the first things I tried to go for, unfortunately, it didn't work out well. There's a number of complications that came up which had me ending my attempt to do so.

There is a way around it though if you're interested in learning about it. But it will have to be done on ZScript's side. Thankfully it's not hard.

First, set the image sprite offsets to 0, then offset the weapon by its four vertices instead. Fun fact: You can adjust the weapon via cvars thanks to ZScript so you can do it real time instead of having to restart the game over and over, to get the effect you want.

I believe the coordinates scale by 320x200, last I checked. It was a while ago. That or 320x240, you'll have to play around with it. That means you'll need to create a scalar for it and disable the percentage, implementing your own on ZScript side that scales up to those values.
User avatar
kevansevans
Spotlight Team
Posts: 420
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: A_OverlayPivot Screen Coordinates flag

Post by kevansevans »

Major Cooke wrote:There is a way around it though if you're interested in learning about it. But it will have to be done on ZScript's side. Thankfully it's not hard.
This would be very much appreciated, because not having these rotations is very frustrating for me. If you can, for the sake of not bloating this thread, could you DM me a more clear explanation? I'm not sure what you mean by offsetting it by it's four vertices?
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: A_OverlayPivot Screen Coordinates flag

Post by Major Cooke »

Sure, though I prefer Discord. But whichever is most convenient for you.
Post Reply

Return to “Feature Suggestions [GZDoom]”