Page 9 of 9

Re: ZScript: Status Bar Questions

PostPosted: Tue Sep 19, 2017 1:19 pm
by Matt
cotton_disciple wrote:Does anyone know how to get powermorph duration?
The same as any other powerup duration, I would speculate? (sorry I don't know for sure)


I'm thinking of possibly implementing a first focal plane reticle to at least one of the guns in HD.

Is there a way to dynamically crop an image, so I wouldn't have to have a different TEXTURES entry for every possible magnification?

Re: ZScript: Status Bar Questions

PostPosted: Tue Sep 19, 2017 2:01 pm
by Blue Shadow

Re: ZScript: Status Bar Questions

PostPosted: Tue Sep 19, 2017 3:23 pm
by ZZYZX
Are you trying to scale? Why not actually scale then?

Re: ZScript: Status Bar Questions

PostPosted: Tue Sep 19, 2017 6:01 pm
by Matt
ZZYZX: I'm trying to scale an image up, but then also crop off the parts of the image that extend beyond certain bounds of the screen.

In this particular situation if I simply scaled the crosshair image you'd see the ends of the crosshair sticking out from where the sides of the scope ought to be.

Blue Shadow: Thanks! That was the function I thought I saw somewhere but couldn't remember the name...

I'm looking at the code for SetClipRect now but I don't see anything indicating what exactly any given SetClipRect call is supposed to clip. I do see, however, some stuff in the source code like "screen->SetClipRect" and whatnot. I take it there's some way to set up some sub-entity for this? Or is this restricted to affecting the entire HUD?

EDIT: Or do I have to call SetClipRect twice, once for this thing and once to set it back to normal to draw other stuff?

Re: ZScript: Status Bar Questions

PostPosted: Tue Sep 19, 2017 10:29 pm
by Blue Shadow
Would studying how it's used in DrawBar help?
https://github.com/coelckers/gzdoom/blo ... r.txt#L977

Re: ZScript: Status Bar Questions

PostPosted: Wed Sep 20, 2017 2:58 am
by Nash
A general practice which I hopefully think is correct is to always save the previous clipping rectangle first so that it can be restored later when you are done clipping your own graphics.

Re: ZScript: Status Bar Questions

PostPosted: Wed Sep 20, 2017 10:07 am
by Blue Shadow
Yeah, that's what DrawBar does.

Re: ZScript: Status Bar Questions

PostPosted: Mon Oct 02, 2017 12:56 pm
by Matt
Thanks guys! I've finally implemented this and it works exactly as hoped!

Is there any way to colourize an image on the HUD (other than to create a green version of it and mark it as translatable)?