fps hide seems to be a special function that i was unable to find inside any inkwidget or inkhud file it might be part of the source code, or the assembly code inside the exe
Default fonts are so goddamn tiny. But if increased they get cut off...
Can you add some explanation what the four numbers mean? It's so much better to let players customize it due to different resolutions etc. VehicleInfo.ink_hp_title:SetMargin(0, 13, 0, 10)
You can try installing RedHotTools and use ink inspector to see what different values does to the HUD element. Experiment and see what you come up with. !IMPORTANT! Remember what you changed and input the same values into the .lua. Then restart your game to see if your changes was applied correctly. Rinse and repeat till your happy with how your HUD looks.
Took me a while to get mine just how I like it . . . Added a bit of code for changing the "letterCase" and tracking Swapped alignments to get proper element positioning Changes I made to the init.lua >
Spoiler:
Show
VehicleInfo.ink_horizontal_panel = inkHorizontalPanel.new() VehicleInfo.ink_horizontal_panel:SetName(CName.new("ap")) VehicleInfo.ink_horizontal_panel:SetAnchor(inkEAnchor.Centered) VehicleInfo.ink_horizontal_panel:SetFitToContent(false) if VehicleDurabilityDisplay.type == Type.Bottom then VehicleInfo.ink_horizontal_panel:SetMargin(0, 0, -15, -5) elseif VehicleDurabilityDisplay.type == Type.Top then VehicleInfo.ink_horizontal_panel:SetMargin(0, 0, -36, 85) end VehicleInfo.ink_horizontal_panel:Reparent(parent)
VehicleInfo.ink_hp_text = inkText.new() VehicleInfo.ink_hp_text:SetName(CName.new("text")) VehicleInfo.ink_hp_text:SetText("100") VehicleInfo.ink_hp_text:SetFontFamily("base\\gameplay\\gui\\fonts\\digital_readout\\digitalreadout.inkfontfamily") VehicleInfo.ink_hp_text:SetFontStyle("Regular") VehicleInfo.ink_hp_text:SetTracking(5) VehicleInfo.ink_hp_text:SetMargin(0, 13, 0, 0) VehicleInfo.ink_hp_text:SetFitToContent(true) VehicleInfo.ink_hp_text:SetJustificationType(textJustificationType.Right) VehicleInfo.ink_hp_text:SetHorizontalAlignment(textHorizontalAlignment.Right) VehicleInfo.ink_hp_text:SetVerticalAlignment(textVerticalAlignment.Center) VehicleInfo.ink_hp_text:SetStyle(ResRef.FromName("base\\gameplay\\gui\\common\\main_colors.inkstyle")) VehicleInfo.ink_hp_text:BindProperty("tintColor", "MainColors.Blue") if VehicleDurabilityDisplay.type == Type.Bottom then VehicleInfo.ink_hp_text:SetFontSize(50) elseif VehicleDurabilityDisplay.type == Type.Top then VehicleInfo.ink_hp_text:SetFontSize(25) end
I use HUDitor to position the speedometer where I wanted it, HUD Painter to customize even more things! But to answer your question those four numbers are how the new HUD element is positioned referencing the anchor points and text alignments. You will see SetMargin() for all the added elements by the MOD ("ap", "title", "text").
Are you able to be a little more specific with what each number means exactly? Because "referencing the anchor points and text alignments" still doesn't help unless I know where the anchor points or the alignments are. A roughly drawn picture in paint indicating the line that each value controls would be great.
Okay Lets see If i can elaborate a little bit more about these numbers; I think I won't be able to really properly explain every aspect they can affect though.
still doesn't help unless I know where the anchor points or the alignments are.
That's why I've suggested using Ink Inspector to experiment with different values and options within the selected HUD element. Its easy to understand once you start making your own changes and see for yourself on what each value will affect, This is a safe way of testing your changes, edits made during a session wont be saved on next launch, that's why its Important to Input the changes your happy with into the .lua as you find your own desired positions and text settings. I'll try and give an easy to understand breakdown:
Spoiler:
Show
1.) Anchor Points/Alignments are points or borders on the Hud element that determines how to position the text in simple referenced locations within the selected HUD widget bounding area (Centered, Centered.Right, Centered.Left, etc.). In Ink Inspector you can Visualize the bounding area by selecting the right HUD element you want to edit, it will be highlighted green up to its borders. Basically the affected HUD's area, are split into the respected anchor points. "Centered = will position element right onto the most central region of the affected area etc.
2.) Alignments reference the anchor point set for a given element and aligns self depending on set option. A Left or Right alignment will reference the anchor point of the selected HUD and will position the element accordingly. Like if you notice your text way out to the side of the HUD widget then that might mean the anchor point of the main HUD widget might be a bit too close to a given border, changing it to somewhere closer to the center will bring the NEW element closer to your desired location.
3.) Setting MARGINS > these are the values I like to call Fine Tuned. They do exactly that! Because the HUD widgets area is a dynamic space the positioning of anchor points and alignments will inevitably be "out of place" from what you expect with just setting anchor points and alignments. This is when the four values come into play. They will nudge the HUD element in pixels depending on your set values. You'll notice in my Code that I have negative values for the "ap" Ink element; that was required to get the positioning just right for my situation. If it wasn't a negative value The Meter will be offset to the left and a bit too close to the "MPH 000", so I used -values to nudge it to the right and down a few pixels. Use +/- values to fine tune your text location down to the pixel :)
Don't forget to have Fun! with it . . . Will love to see what you come up with, Take care Choom!
I find the durability counter working but sometimes, especially when reloading a save with a car already damaged, the counter goes back to 100 and not (let's say 54) where it was beforehand
I'm still adjusting it, but so far this is what works best for me to make the text more apparent.
Line 163-165: VehicleInfo.ink_hp_title:SetFontSize(36) VehicleInfo.ink_hp_title:SetOpacity(0.8) VehicleInfo.ink_hp_title:SetMargin(0, 13, 0, 10)
Line 179: VehicleInfo.ink_hp_text:SetMargin(0, 13, 0, 10) Line 189 (or Line 187 if you use the Bottom version): VehicleInfo.ink_hp_text:SetFontSize(42)
48 comments
that would also keep it visible in FPS mode
it might be part of the source code, or the assembly code inside the exe
Can you add some explanation what the four numbers mean? It's so much better to let players customize it due to different resolutions etc.
VehicleInfo.ink_hp_title:SetMargin(0, 13, 0, 10)
Took me a while to get mine just how I like it . . .
Added a bit of code for changing the "letterCase" and tracking
Swapped alignments to get proper element positioning
Changes I made to the init.lua >
VehicleInfo.ink_horizontal_panel = inkHorizontalPanel.new()
VehicleInfo.ink_horizontal_panel:SetName(CName.new("ap"))
VehicleInfo.ink_horizontal_panel:SetAnchor(inkEAnchor.Centered)
VehicleInfo.ink_horizontal_panel:SetFitToContent(false)
if VehicleDurabilityDisplay.type == Type.Bottom then
VehicleInfo.ink_horizontal_panel:SetMargin(0, 0, -15, -5)
elseif VehicleDurabilityDisplay.type == Type.Top then
VehicleInfo.ink_horizontal_panel:SetMargin(0, 0, -36, 85)
end
VehicleInfo.ink_horizontal_panel:Reparent(parent)
VehicleInfo.ink_hp_title = inkText.new()
VehicleInfo.ink_hp_title:SetName(CName.new("title"))
VehicleInfo.ink_hp_title:SetText(GetLocalizedText("LocKey#91867"))
VehicleInfo.ink_hp_title:SetFontFamily("base\\gameplay\\gui\\fonts\\raj\\raj.inkfontfamily")
VehicleInfo.ink_hp_title:SetFontStyle("Medium")
VehicleInfo.ink_hp_title:SetFontSize(25)
VehicleInfo.ink_hp_title:SetTracking(5)
VehicleInfo.ink_hp_title:SetLetterCase("UpperCase")
VehicleInfo.ink_hp_title:SetOpacity(0.75)
VehicleInfo.ink_hp_title:SetMargin(15, 10, 0, 0)
VehicleInfo.ink_hp_title:SetFitToContent(true)
VehicleInfo.ink_hp_title:SetJustificationType(textJustificationType.Left)
VehicleInfo.ink_hp_title:SetHorizontalAlignment(textHorizontalAlignment.Left)
VehicleInfo.ink_hp_title:SetVerticalAlignment(textVerticalAlignment.Center)
VehicleInfo.ink_hp_title:SetStyle(ResRef.FromName("base\\gameplay\\gui\\common\\main_colors.inkstyle"))
VehicleInfo.ink_hp_title:BindProperty("tintColor", "MainColors.MildRed")
VehicleInfo.ink_hp_title:Reparent(VehicleInfo.ink_horizontal_panel)
VehicleInfo.ink_hp_text = inkText.new()
VehicleInfo.ink_hp_text:SetName(CName.new("text"))
VehicleInfo.ink_hp_text:SetText("100")
VehicleInfo.ink_hp_text:SetFontFamily("base\\gameplay\\gui\\fonts\\digital_readout\\digitalreadout.inkfontfamily")
VehicleInfo.ink_hp_text:SetFontStyle("Regular")
VehicleInfo.ink_hp_text:SetTracking(5)
VehicleInfo.ink_hp_text:SetMargin(0, 13, 0, 0)
VehicleInfo.ink_hp_text:SetFitToContent(true)
VehicleInfo.ink_hp_text:SetJustificationType(textJustificationType.Right)
VehicleInfo.ink_hp_text:SetHorizontalAlignment(textHorizontalAlignment.Right)
VehicleInfo.ink_hp_text:SetVerticalAlignment(textVerticalAlignment.Center)
VehicleInfo.ink_hp_text:SetStyle(ResRef.FromName("base\\gameplay\\gui\\common\\main_colors.inkstyle"))
VehicleInfo.ink_hp_text:BindProperty("tintColor", "MainColors.Blue")
if VehicleDurabilityDisplay.type == Type.Bottom then
VehicleInfo.ink_hp_text:SetFontSize(50)
elseif VehicleDurabilityDisplay.type == Type.Top then
VehicleInfo.ink_hp_text:SetFontSize(25)
end
But to answer your question those four numbers are how the new HUD element is positioned referencing the anchor points and text alignments. You will see SetMargin() for all the added elements by the MOD ("ap", "title", "text").
Its easy to understand once you start making your own changes and see for yourself on what each value will affect, This is a safe way of testing your changes, edits made during a session wont be saved on next launch, that's why its Important to Input the changes your happy with into the .lua as you find your own desired positions and text settings.
I'll try and give an easy to understand breakdown:
In Ink Inspector you can Visualize the bounding area by selecting the right HUD element you want to edit, it will be highlighted green up to its borders. Basically the affected HUD's area, are split into the respected anchor points.
"Centered = will position element right onto the most central region of the affected area etc.
2.) Alignments reference the anchor point set for a given element and aligns self depending on set option. A Left or Right alignment will reference the anchor point of the selected HUD and will position the element accordingly. Like if you notice your text way out to the side of the HUD widget then that might mean the anchor point of the main HUD widget might be a bit too close to a given border, changing it to somewhere closer to the center will bring the NEW element closer to your desired location.
3.) Setting MARGINS > these are the values I like to call Fine Tuned. They do exactly that!
Because the HUD widgets area is a dynamic space the positioning of anchor points and alignments will inevitably be "out of place" from what you expect with just setting anchor points and alignments.
This is when the four values come into play. They will nudge the HUD element in pixels depending on your set values. You'll notice in my Code that I have negative values for the "ap" Ink element; that was required to get the positioning just right for my situation. If it wasn't a negative value The Meter will be offset to the left and a bit too close to the "MPH 000", so I used -values to nudge it to the right and down a few pixels. Use +/- values to fine tune your text location down to the pixel :)
Don't forget to have Fun! with it . . .
Will love to see what you come up with, Take care Choom!
Works on update 2.21 (I installed it manually)
Tho this font is so damn small XD
Line 163-165:
VehicleInfo.ink_hp_title:SetFontSize(36)
VehicleInfo.ink_hp_title:SetOpacity(0.8)
VehicleInfo.ink_hp_title:SetMargin(0, 13, 0, 10)
Line 179:
VehicleInfo.ink_hp_text:SetMargin(0, 13, 0, 10)
Line 189 (or Line 187 if you use the Bottom version):
VehicleInfo.ink_hp_text:SetFontSize(42)
Is there a way to change the size? I'm using VCR font from Custom Fonts - https://www.nexusmods.com/cyberpunk2077/mods/2392?tab=posts
NVM found it. Literally says SetFontSize lmaoo. Thanks!
In line 163 there is this:
VehicleInfo.ink_hp_title:SetFontSize(15)
Change to your liking.
Does not currently work on update 2.2 if anyone asks
Does work after updating all core mods