Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
0739c158
Commit
0739c158
authored
Nov 27, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rander deck
parent
3a6c9638
Pipeline
#18136
passed with stages
in 2 minutes and 20 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
src/ui/Duel/simpleDuel/config.ts
src/ui/Duel/simpleDuel/config.ts
+19
-0
src/ui/Duel/simpleDuel/deck.ts
src/ui/Duel/simpleDuel/deck.ts
+38
-0
src/ui/Duel/simpleDuel/mod.tsx
src/ui/Duel/simpleDuel/mod.tsx
+4
-0
No files found.
src/ui/Duel/simpleDuel/config.ts
View file @
0739c158
...
@@ -11,9 +11,18 @@ export const GroundShape = () => {
...
@@ -11,9 +11,18 @@ export const GroundShape = () => {
export
const
CardSlotShape
=
()
=>
{
export
const
CardSlotShape
=
()
=>
{
return
{
width
:
0.8
,
height
:
1
,
depth
:
0.05
};
return
{
width
:
0.8
,
height
:
1
,
depth
:
0.05
};
};
};
export
const
DeckSlotShape
=
()
=>
{
return
{
width
:
0.8
,
height
:
1
,
depth
:
0.5
};
};
export
const
ExtraDeckSlotShape
=
()
=>
{
return
{
width
:
0.8
,
height
:
1
,
depth
:
0.2
};
};
export
const
CardSlotRotation
=
()
=>
{
export
const
CardSlotRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
};
};
export
const
DeckSlotRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
};
// 手牌
// 手牌
export
const
HandShape
=
()
=>
{
export
const
HandShape
=
()
=>
{
...
@@ -37,3 +46,13 @@ export const extraMonsterColor = () => {
...
@@ -37,3 +46,13 @@ export const extraMonsterColor = () => {
export
const
MagicColor
=
()
=>
{
export
const
MagicColor
=
()
=>
{
return
BABYLON
.
Color3
.
Blue
();
return
BABYLON
.
Color3
.
Blue
();
};
};
// 卡组
export
const
DeckColor
=
()
=>
{
return
BABYLON
.
Color3
.
Gray
();
};
// 额外卡组
export
const
ExtraDeckColor
=
()
=>
{
return
BABYLON
.
Color3
.
Purple
();
};
src/ui/Duel/simpleDuel/deck.ts
0 → 100644
View file @
0739c158
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
./config
"
;
export
default
(
scene
:
BABYLON
.
Scene
)
=>
{
// 卡组
const
deck
=
BABYLON
.
MeshBuilder
.
CreateBox
(
"
deck
"
,
CONFIG
.
DeckSlotShape
(),
scene
);
// 位置
deck
.
position
=
new
BABYLON
.
Vector3
(
3.2
,
0.5
,
-
3.2
);
// 旋转
deck
.
rotation
=
CONFIG
.
DeckSlotRotation
();
// 材质
const
deckMaterial
=
new
BABYLON
.
StandardMaterial
(
"
deckMaterial
"
,
scene
);
deckMaterial
.
diffuseColor
=
CONFIG
.
DeckColor
();
deck
.
material
=
deckMaterial
;
// 额外卡组
const
extraDeck
=
BABYLON
.
MeshBuilder
.
CreateBox
(
"
exraDeck
"
,
CONFIG
.
ExtraDeckSlotShape
(),
scene
);
// 位置
extraDeck
.
position
=
new
BABYLON
.
Vector3
(
-
3.3
,
0.5
,
-
3.2
);
// 旋转
extraDeck
.
rotation
=
CONFIG
.
DeckSlotRotation
();
// 材质
const
extraDeckMaterial
=
new
BABYLON
.
StandardMaterial
(
"
extraDeckMaterial
"
,
scene
);
extraDeckMaterial
.
diffuseColor
=
CONFIG
.
ExtraDeckColor
();
extraDeck
.
material
=
extraDeckMaterial
;
};
src/ui/Duel/simpleDuel/mod.tsx
View file @
0739c158
...
@@ -12,6 +12,7 @@ import renderHands from "./hands";
...
@@ -12,6 +12,7 @@ import renderHands from "./hands";
import
renderMonsters
from
"
./monsters
"
;
import
renderMonsters
from
"
./monsters
"
;
import
renderExtraMonsters
from
"
./extraMonsters
"
;
import
renderExtraMonsters
from
"
./extraMonsters
"
;
import
renderMagics
from
"
./magics
"
;
import
renderMagics
from
"
./magics
"
;
import
renderDeck
from
"
./deck
"
;
import
*
as
CONFIG
from
"
./config
"
;
import
*
as
CONFIG
from
"
./config
"
;
import
{
CardMeta
}
from
"
../../../api/cards
"
;
import
{
CardMeta
}
from
"
../../../api/cards
"
;
...
@@ -69,6 +70,9 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
...
@@ -69,6 +70,9 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
// 创建手牌
// 创建手牌
renderHands
(
hands
,
scene
);
renderHands
(
hands
,
scene
);
// 创建卡组
renderDeck
(
scene
);
// 创建地板
// 创建地板
const
ground
=
BABYLON
.
MeshBuilder
.
CreateGround
(
const
ground
=
BABYLON
.
MeshBuilder
.
CreateGround
(
"
ground
"
,
"
ground
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment