MENUDEF - Positioning every menu in the bottom right corner

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
FFFFRRRR
Posts: 99
Joined: Sat Nov 04, 2017 3:33 am

MENUDEF - Positioning every menu in the bottom right corner

Post by FFFFRRRR »

Hello.

I am currently working on menus for my project, including main-, episode- and skill-menus.
I would like all of them to be positioned in the bottom right corner of the screen, as I believe it fits the aesthetic very well. This works easily with the main menu.

Code: Select all

LISTMENU "MainMenu"
{
	Size 450,450
	Font "bigfont","green","olive"
	Position 420, 305
	
	Selector "mmnu_s",10,10
	
	//triangle
	StaticPatch 340, 220, "MMNU_1"

	TextItem "New Game",	"n",	"PlayerclassMenu"
	TextItem "Load one",	"l",	"LoadGameMenu"
	TextItem "Save one",	"s",	"SaveGameMenu"
	TextItem "Settings",	"o",	"OptionsMenu"
	TextItem "Quit it",		"q",	"QuitMenu"
}
Looks like I want it to.
Spoiler:
However, the skill- and episode-menus are giving me a bit of trouble. I know that their contents depend on ZMAPINFO, and that the program automatically fills it.
The positioning seems to work differently with this. My menudef on the episodemenu:

Code: Select all

ListMenu "EpisodeMenu"
{
	Size 450,450
	Font "bigfont","green","olive"
	Selector "mmnu_s",10,10
	StaticPatch 340, 220, "MMNU_1"
	Position 420, 305
}
What it looks like:
Spoiler:
It seems like the positioning works very differently, as the static triangle is in a different position when using the same coordinates. Maybe it is hardcoded, and cant be changed in this way.
I would like to know if there is a way to position all menus in the bottom right corner, or if this is not possible due to the way they are made.
Thank you in advance!
User avatar
eharper256
Posts: 1086
Joined: Sun Feb 25, 2018 2:30 am
Location: UK
Contact:

Re: MENUDEF - Positioning every menu in the bottom right cor

Post by eharper256 »

Massive bit of Necromancy here; but I'd actually like to know about this as well, as I'm trying to convert my menus from the forced Clean pixels method that I enabled as a stopgap measure for menus back ages ago, over to the Canvas method.

SkillMenu does not seem to ever respect the x part of the Position x,y command, except if it, bizarrely, has a negative value, which is apparently fine (and obviously throws your text partially off the screen). The X co-ordinate of the menu appears fixed to be flush at 0, so the selector is not visible. Using centermenu does indeed centre it, but again the X co-ordinate it centres around seems to be forced to be about 30 pixels in so again often falls offscreen based on the length of the text in MAPINFO.

Similarly, EpisodeMenu does not respect the Y axis of the Position x,y command with the same conditions as above.

I'm wondering if Text length and number of strings is a factor that affects this?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: MENUDEF - Positioning every menu in the bottom right cor

Post by Graf Zahl »

For such specialized means you will have to provide a custom menu class where you can make adjustments to the item coordinates.
User avatar
eharper256
Posts: 1086
Joined: Sun Feb 25, 2018 2:30 am
Location: UK
Contact:

Re: MENUDEF - Positioning every menu in the bottom right cor

Post by eharper256 »

Graf Zahl wrote:For such specialized means you will have to provide a custom menu class where you can make adjustments to the item coordinates.
Just to make the menus respect the position command requires a special class?!? :? Yikes.
Post Reply

Return to “Scripting”