Открыть боковую панель
Teknokomo
universo-phaser
Коммиты
bf8dd22c
Коммит
bf8dd22c
создал
Ноя 23, 2023
по автору
Medvedev Anton
Просмотр файлов
Конфиг Phaser вынесен из стартовой сцены
владелец
95b3bfac
Изменения
2
Скрыть пробелы
Построчно
Рядом
universo-frontend/src/apps/spaces-2d/PhaserConfig.ts
0 → 100644
Просмотр файла @
bf8dd22c
import
{
AUTO
,
Scale
,
Types
}
from
'
phaser
'
;
export
const
getPhaserConfig
=
(
scene
:
any
):
Types
.
Core
.
GameConfig
=>
({
type
:
AUTO
,
parent
:
'
phaser-container
'
,
width
:
window
.
innerWidth
,
height
:
window
.
innerHeight
,
scale
:
{
mode
:
Scale
.
FIT
,
autoCenter
:
Scale
.
CENTER_BOTH
,
},
scene
:
scene
,
plugins
:
{
// scene: [
// {
// key: 'rexUI',
// plugin: RexPlugins,
// mapping: 'rexUI',
// },
// // ...
// ],
},
});
universo-frontend/src/apps/spaces-2d/Spaces2D.vue
Просмотр файла @
bf8dd22c
...
@@ -28,6 +28,7 @@ import CreateToolbar from '../toolbar/CreateToolbar';
...
@@ -28,6 +28,7 @@ import CreateToolbar from '../toolbar/CreateToolbar';
import
{
watch
,
computed
}
from
'
vue
'
;
import
{
watch
,
computed
}
from
'
vue
'
;
import
{
Router
}
from
'
vue-router
'
;
import
{
Router
}
from
'
vue-router
'
;
import
UIPlugin
from
'
phaser3-rex-plugins/templates/ui/ui-plugin
'
;
import
UIPlugin
from
'
phaser3-rex-plugins/templates/ui/ui-plugin
'
;
import
{
getPhaserConfig
}
from
'
./PhaserConfig
'
;
declare
const
window
:
{
declare
const
window
:
{
router
:
Router
;
router
:
Router
;
...
@@ -154,28 +155,7 @@ class EndlessCanvas extends Phaser.Scene {
...
@@ -154,28 +155,7 @@ class EndlessCanvas extends Phaser.Scene {
}
}
}
}
const config: Phaser.Types.Core.GameConfig = {
const config = getPhaserConfig(EndlessCanvas);
type: Phaser.AUTO,
parent:
'
phaser
-
container
'
,
width: window.innerWidth,
height: window.innerHeight,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
},
scene: EndlessCanvas,
plugins: {
// scene: [
// {
// key:
'
rexUI
'
,
// plugin: RexPlugins,
// mapping:
'
rexUI
'
,
// },
// // ...
// ],
},
};
export default {
export default {
name:
'
EndlessCanvas
'
,
name:
'
EndlessCanvas
'
,
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать