So I could do this
Code: Select all
decal MyDecal235 235
{
offset 32,64
pic Image235
}
Moderator: GZDoom Developers
Code: Select all
decal MyDecal235 235
{
offset 32,64
pic Image235
}
Awesome!RockstarRaccoon wrote:You know, if you're at it, there should be a possibility for randomization there.
Anyway, I'm about to rework the decal-placement code in the rendering stuff, so... I'll try to remember that this is a request and get back with notes.
A workaround you could use and one that I have used in the past is to render your crosshair as an overlay on the weapon and set its offsets with A_OverlayOffset. https://zdoom.org/wiki/A_OverlayOffsetSir Robin wrote:Question - and this should probably be another feature request but I'm asking if it's reasonably feasible and worth requesting - Would it be possible to make texture offsets as fixed point instead of integers? In another thread I was trying to use a sprite as a cross hair, and wanted to center it on a pixel center instead of a pixel border. Is that feasible or is that a completely backwards-ass way to do that?
Yeah, there's a few different ways to handle it on a 2d plane. I'm actually using it as a 3d cursor though, as in I spawn it as a sprite out in the 3d world to mark exactly what I'm targeting. So think of it like a laser pointer. But I cannot spawn a sprite where it's origin is in the middle of a pixel, it's always going to be in the middle of a group of four pixels.22alpha22 wrote:A workaround you could use and one that I have used in the past is to render your crosshair as an overlay on the weapon and set its offsets with A_OverlayOffset. https://zdoom.org/wiki/A_OverlayOffsetSir Robin wrote:Question - and this should probably be another feature request but I'm asking if it's reasonably feasible and worth requesting - Would it be possible to make texture offsets as fixed point instead of integers? In another thread I was trying to use a sprite as a cross hair, and wanted to center it on a pixel center instead of a pixel border. Is that feasible or is that a completely backwards-ass way to do that?
There are other more robust solutions as well but they would require ZScript and EventHandlers or a custom statusbar/HUD.
Spoiler:The red X is my 3-d crosshair, the green dot is my 2d HUD crosshair. If they were perfectly aligned the green dot would be exactly in the middle of that red X, but that's not possible because that's only 1 pixel and I can't center it on one pixel. It's always going to be on one of the corners of that middle pixel. That's why I'd like to suggest that offsets could be floating point but I don't know how possible that is in the underlying code or what other things it would break. Alternatively I'd suggest adding a new flag, like +OffsetToMidPixel that would tell the rendered to automatically add 0.5 to the offsets when rendering.
They already are. There's a ton of precise double math in here to make that work.Sir Robin wrote:Would it be possible to make texture offsets as fixed point instead of integers?
Code: Select all
double xOffset;
double yOffset;
double xScale;
double yScale;
Spoiler:...when I enter a float in UDB, it accepts the float and will even save it as one, but it doesn't render in visual mode...