我正在制作游戏,并且UI出现问题。我使它与屏幕尺寸成比例。在16:9中,它看起来像我想要的: UI is where I want it to be.
但是当我切换到2160 x 1080时,我遇到了问题。 My UI is outside my game screen
我希望18:9的UI保持与16:9相同的位置。有什么解决办法可以使其保持在游戏范围内?
答案 0 :(得分:0)
symfony-crud> php bin/console make:entity Task
created: src/Entity/Task.php
created: src/Repository/TaskRepository.php
Entity generated! Now let's add some fields!
You can always add more fields later manually or by re-running this command.
New property name (press <return> to stop adding fields):
> title
In DebugClassLoader.php line 337:
Warning: include(D:\OneDrive\ドã‚ュメント\Project\Php\symfony-crud\vendor\composer/../symfony/console/Event/ConsoleErrorEvent.php): failed to open stream: No such file or directory
make:entity [-a|--api-resource] [--regenerate] [--overwrite] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction]
[-e|--env ENV] [--no-debug] [--] <command> [<name>]
对象-> Canvas
组件:
随屏幕尺寸缩放 匹配= 0(垂直应用为0,横向为1)
然后您需要更改ui对象的锚点,以使其不从边界对齐,而是从中心对齐。
答案 1 :(得分:0)