简体   繁体   中英

how to fix button position when resolution is changed in unity after built

When I add a button and play the game in Unity editor, it remains in its required position. But when I build and run it, the button's position gets misplaced. I want 1366 x 768 screen resolution with all buttons well positioned.

I suggest you to use Canvas Scaler (to control the scale of your game on several devices) and Anchors (to keep the elements in the position where you want to) on your buttons.

http://docs.unity3d.com/es/current/Manual/script-CanvasScaler.html http://docs.unity3d.com/Manual/UIBasicLayout.html

如果您的按钮在编辑器中是正常大小并导出到您的手机会使它们变小,请确保您的 Canvas 具有 Canvas Scaler 组件,并将 UI 缩放模式设置为“随屏幕大小缩放”。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM