Scripts / how to place the radar underneath my hud.

Author
Message
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 7th Oct 2018 23:03 Edited at: 7th Oct 2018 23:06
hi all . if i want to set the radar underneath my hud that i use.
how will i do it. ?
the part of the radar script were you set the Depth looks like this.: (SetSpriteDepth ( radarSprite , 100 ) )

my hud script looks like this: (SetSpriteDepth ( mh_1_sprite , 50 )


i have been playing around with the SetSpriteDepth in both scripts but the radar stays on top of the hud.
any help would be awesome.

Thanks
Pcs
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 8th Oct 2018 20:04
Please any suggestions on how to set the SetSpriteDepth function .
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Oct 2018 20:52
i think the radar uses PasteSprite? is there a PasteSpriteDepth() command for editing the depth on the paste in global.lua?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 9th Oct 2018 00:55
this is the script for the radar. :


i dont see any PasteSpriteDepth() command.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 9th Oct 2018 08:31
I would suggest running the hud code after the radar code.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 9th Oct 2018 09:16
@Dvader, at this point I am loading the radar first and after that i activade the HUD, but still the radar is on top. As soon as I am at the house I can send my scripts to you or Smallg, if you guys can have a look at it. It would be fantastic
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 9th Oct 2018 09:50
Here is the depth command as listed.


Just make sure you set the ones you want behind others to be a higher depth value. If you use paste sprite, I imagine the depth is ignored, but I don't often use it. It's not really necessary for most applications. You may want to paste several sprites over another in order to then grab the image as a new sprite for example. Then it is the one to use

I can have a look at the script if you post it if your still stuck.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 9th Oct 2018 10:34 Edited at: 9th Oct 2018 10:35
@Dvader. In the first two code snippets of this thread you wil see the depth of the HUD is 50 and the radar is 100. But it does not work. I have even set the depth of the HUD on 0 but it did not help.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 9th Oct 2018 13:30
I was under the impression that sprite depth only worked for pasted sprites and not positioned sprites. Im pretty sure it was smallg who told me that when i wad working on my own huds a while back and i couldnt get the text to go in fromt of the sprites.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 10th Oct 2018 15:18 Edited at: 10th Oct 2018 15:21
so i have tried but still no luck.
here is a picture of what i have in mind.


but i need the radar to be under the hud. the hud is one of maiacoimbra69 huds.
https://forum.game-guru.com/thread/218873#msg2588993
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Attachments

Login to view attachments
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 10th Oct 2018 16:24
Quote: "sprite depth only worked for pasted sprites and not positioned sprites"

Probably more to do with text not being affected by sprite depth. Depth works fine with other sprites, pasting should override any depth settings, it used to be used when manually doing double buffering, but is not really needed for that these days as most engines do it for you well enough without slowing too much.

I've just wrote a quick HUD script and have no issues with getting the radar to move either way. Default radar setting seems to be 100 same as you have above and it shows behind my image. Set it to 49 and it goes in front. Maybe your HUD code is the issue; the code above is probably called only once as it is a function. Make sure you have this part, SetSpritePosition ( mh_1_sprite , 200 , 200 ), in your main loop, as it needs to be updated along with the radar. I had to change the position to 0,0 to see it here, as 200, 200 sent it offscreen entirely.

I've uploaded the code I wrote to test this.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.

Attachments

Login to view attachments
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Oct 2018 19:44
it's ok i fixed it, the issue was that the hud script uses PasteSpritePosition to make sure any text etc is in front of it... this causes it to always be behind the radar by default (as the radar is not pasted) regardless of depth changes.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 10th Oct 2018 20:22
smallg you are a star my friend. thank you very much its working 100%
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 10th Oct 2018 21:38
Quote: "the hud script uses PasteSpritePosition"

As I thought Without seeing the code. My above posts vindicate this

@ PCS Glad your up and running.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 11th Oct 2018 00:36
thank you Dvader.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Login to post a reply

Server time is: 2024-12-22 20:24:51
Your offset time is: 2024-12-22 20:24:51