ZScript: Status Bar Questions

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Re: ZScript: Status Bar Questions

Postby Matt » Tue Sep 19, 2017 12:19 pm

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?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: ZScript: Status Bar Questions

Postby Blue Shadow » Tue Sep 19, 2017 1:01 pm

User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ZScript: Status Bar Questions

Postby ZZYZX » Tue Sep 19, 2017 2:23 pm

Are you trying to scale? Why not actually scale then?
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Re: ZScript: Status Bar Questions

Postby Matt » Tue Sep 19, 2017 5:01 pm

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?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: ZScript: Status Bar Questions

Postby Blue Shadow » Tue Sep 19, 2017 9:29 pm

Would studying how it's used in DrawBar help?
https://github.com/coelckers/gzdoom/blo ... r.txt#L977
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ZScript: Status Bar Questions

Postby Nash » Wed Sep 20, 2017 1:58 am

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.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: ZScript: Status Bar Questions

Postby Blue Shadow » Wed Sep 20, 2017 9:07 am

Yeah, that's what DrawBar does.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: ZScript: Status Bar Questions

Postby Matt » Mon Oct 02, 2017 11:56 am

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)?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Previous

Return to Scripting

Who is online

Users browsing this forum: Trendiction.de [Bot] and 2 guests