#Set Variable with Settings in Manifest.json
1 messages · Page 1 of 1 (latest)
I tried using _global_variables.json , but when I used the variable for setting the size of an image in hud_screen.json, the image stopped displaying. So I just resorted to hardcoding.
When you add a resource pack to your global resource packs ingame, if that resource pack has subpacks, a gear pops up on the bottom right corner of the resource pack card. That same gear pops up if you add "settings" :[] to your manifest.json as well. I found out I was able to add sliders and labels into the "settings" part of the manifest.json , but I could not understand how I could use that to change the value of a variable.
Ok, so you added a subpack and want to change the value of a variable based on it?
I'm just going to rely on an overlay pack to solve this, because using a variable just made the image not display.
Yes, I have multiple subpacks in my resource pack, and would like to have a variable that influences the size of a custom image in each of the subpacks
Over here, I meant, when using a variable for changing the size of an image:
"type": "image",
"texture": "textures/MythicFunk",
"anchor_from": "center",
"anchor_to": "center",
"size": ["$variable", "$variable"],
The image would just not display, even though that variable was already defined in the global variables json
Maybe try something like this
"element": {
"$example_variable": [ 50, 50 ],
"Size": "$example_variable"
}
I think it wont work with images though, because the array for "size" requires string values. But I will try setting the variable as an array, instead of a string
um... size will require string only if you use something like "20%" or something.
oh.. ya Im using percents
then how about
"$variab": [ "1%" , "2%" ],
"size": "$variab"
Anyways, I got it to work by creating a new pack as an overlay with subpacks as the slider for my variable. If that stops working in the future, I will revisit this idea. But since its not broken, Im not going to try and over complicate it.
Thank you for your help though
Lemme try this myself tho as even i dont know if this work or not.
Want me to send you my pack?
Welp, gl.
no, i will try it onto something i have.
ok, good luck.
Idk what happens, the variable works but the size is always 100% of the screen, no matter weather it is a float or a string. Did you got the same issue as this?
(i was using button btw)
^ Same for Image too
Instead of 100%, it seemed like 0% to me. Nothing was displaying. Im 99% sure its a bug
So for now, if anyone tries this, I guess they will have to resort to using more than one resource pack. One pack with all the content, and an overlay pack with subpacks to change a hardcoded number..