Scripts / Text and Hud Layer Issue

Author
Message
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 1st Dec 2017 06:03 Edited at: 1st Dec 2017 06:03
Hi everyone, I'm having an issue here. What layer is the default HUD layers on? Because when I create sprite huds that fill the screen they seem to layer themselves over top of the health and prompt text display.

Figured this would be an issue fixed with:
SetSpriteDepth: SetSpriteDepth ( mySprite , 10 ) (0 is front, 100 is back)

Even setting the sprite to layer 100 does not throw it behind text and weapon and health huds. Is there any work-around for this? Or is there a possibility to bump the text and health huds to the very front of the screen or at least a depth of 50?
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st Dec 2017 09:23
Try PasteSprite instead - though you need to call it every frame to keep it visible.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 1st Dec 2017 12:53
Aye, as smallg said, use PasteSprite, the normal sprites are on fixed layers, by creaing a sprite (off screen) then using a PasteSprite to paste a copy where you want it you can select the layer it displays on.

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.
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 2nd Dec 2017 04:14 Edited at: 2nd Dec 2017 04:27
I'm using that and it seems to be not be working :/


function hud_future_init(e)
sspr0 = CreateSprite(LoadImage("scriptbank\\images\\huds\\001.png"))
SetSpriteDepth ( sspr0,100)
SetSpritePosition(sspr0,0,0)
--PasteSpritePosition(sspr0,0,0)
PasteSprite ( sspr0 )
end
function hud_future_main(e)
end


I've also tried pasting the sprite position in at different depth and text still and huds appear below it.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 2nd Dec 2017 08:04
Teabone

You need to call a "SetSpritePosition" before you call a "PasteSpritePosition", on startup.
You need to call a "PasteSpritePosition" at least one script cycle after the "SetSpritePosition" is called.
So a "PasteSpritePosition" does not work in the init function.

If you do use a "PasteSpritePosition" in the init function, it "Sets" the sprite to position 0,0
Just the same as it does if you do not call a "SetSpritePosition", on startup.

So using a "PasteSpritePosition" in the main function will layer an image behind the ammo/health hud and prompts.

Cheers

Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, ~3.6GHz, Windows 10, 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768.
Operating System: Windows 10 Home 64-bit (10.0, Build 15063) (15063.rs2_release.170317-1834)
PT V9.0 3DMark=4344, Passmark=3291.

[RIP] Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
PT V9.0 3DMark=377, Passmark=1222.
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 2nd Dec 2017 19:01 Edited at: 2nd Dec 2017 19:03
Thanks so much, have a ton of great hud tests going on and this solves a lot of the issues I was having. Does anyone know what layer depth the Game Guru huds are naturally on? If a set one at all.

(if i a mod would like to move this to scripting, that might be better for those that search old topics)
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Dec 2017 19:29
They're not on the same system as the sprites, the SetSpriteDepth command only really works for moving sprites above/below other self created sprites.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 2nd Dec 2017 19:52
Moved to scripting at OP's request.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Login to post a reply

Server time is: 2024-12-23 00:42:59
Your offset time is: 2024-12-23 00:42:59