Shadows-of-Fire / PackMenu

Tool for editing the main menu in modpacks.
MIT License
16 stars 10 forks source link

I'm confused about button anchors. #29

Closed JAcamp1 closed 3 years ago

JAcamp1 commented 3 years ago

I'm trying to right align everything so I expect to simply do TOP_LEFT anchor and then offset by a y value, but it seems that what I'm inputting is wrong as the mod does not draw the box in later processes. How am I messing up here? Example SinglePlayer Button

{ "x": 0, "y": -125, "width": 100, "height": 20, "langKey": "menu.singleplayer", "action": "OPEN_GUI", "anchor": "TOP_LEFT", "data": "SINGLEPLAYER" }<

Shadows-of-Fire commented 3 years ago

I assume your y-value is just too far off the screen. The anchor point is just a reference that starts your position (that is related to current screen width/height that lets things scale better with gui scale). Fixed offsets are applied after calculating the anchor point.

Top left is (0,0) the top left of the screen. You're attempting to draw a button at (0,-125) which is uh... well, you can think of where that might be.

JAcamp1 commented 3 years ago

ah, I see, thanks for pointing out the stupids.