Custom-Main-Menu icon indicating copy to clipboard operation
Custom-Main-Menu copied to clipboard

Hi ! HI ! HIII ! How to make a button

Open ShlushyMod opened this issue 4 years ago • 2 comments

No, I won't say Hi ! again ! Like the title say, I can't make a button ! How to make a button !

ShlushyMod avatar Sep 06 '20 10:09 ShlushyMod

	"buttonexample":
	{
		"text" : "Test.",
		"hoverText" : "§nTest.",
		"posX" : 36,
		"posY" : 70,
                    "texture" : "test:btnexample.png",
		"alignment" : "top_left",
		"action" :
		{
			"type" : "openLink",
			"link" : "www.example.com"
		}
            }

Don't forget if there's something after this add a comma after the last curly bracket Buttons have 2 states hover and nohover basically you can create a texture for it with 2 states with the width of 16 and height of 32, button states occupy a 16x16 or you can have no like hover animation and instead make the text/color (or both) change when hovered there's also actions like { "type" : "openGui", "gui" : "example2ndgui" } (You can create custom guis you need more json files if so { "type" : "connectToServer", "ip" : "play.skycade.net" } (example server btw it does actually exist tho) { "type" : "loadWorld", "dirName" : "John's favorite world", "saveName" : "blegh" (optional) } (random name for world) { "type" : "openFolder", "folderName" : "mods" (uses minecraft instance folder as root folder) } https://www.curseforge.com/minecraft/mc-mods/custom-main-menu/pages/custom-main-menu/actions https://pastebin.com/dJzLgnSL (List of open-able guis by default)

Deepfried-Chips avatar Sep 07 '20 12:09 Deepfried-Chips

if your talking about the image being halfed, every button requires a hover image. all you need to do I reproduce the image in either the same or different format then place it directly below the current image. all will be in the same image. the top half is what appears as the normal image and the bottom half will only appear when they hover over the image.

TheCraftedGamer avatar Nov 18 '20 09:11 TheCraftedGamer