Commit 03b929ca authored by Chunchi Che's avatar Chunchi Che

update ui

parent 3bef189a
Pipeline #18843 passed with stages
in 2 minutes and 30 seconds
...@@ -6,7 +6,7 @@ export default (scene: BABYLON.Scene) => { ...@@ -6,7 +6,7 @@ export default (scene: BABYLON.Scene) => {
const shape = CONFIG.CardSlotShape(); const shape = CONFIG.CardSlotShape();
for (let i in xs) { for (let i in xs) {
const slot = BABYLON.MeshBuilder.CreateBox( const slot = BABYLON.MeshBuilder.CreatePlane(
`extraMonster${i}`, `extraMonster${i}`,
shape, shape,
scene scene
...@@ -24,7 +24,10 @@ export default (scene: BABYLON.Scene) => { ...@@ -24,7 +24,10 @@ export default (scene: BABYLON.Scene) => {
"extraMonsterMaterial", "extraMonsterMaterial",
scene scene
); );
extraMonsterMaterial.diffuseColor = CONFIG.extraMonsterColor(); extraMonsterMaterial.diffuseTexture = new BABYLON.Texture(
`http://localhost:3030/images/card_slot.png`
);
extraMonsterMaterial.diffuseTexture.hasAlpha = true;
slot.material = extraMonsterMaterial; slot.material = extraMonsterMaterial;
} }
}; };
...@@ -7,7 +7,7 @@ export default (scene: BABYLON.Scene) => { ...@@ -7,7 +7,7 @@ export default (scene: BABYLON.Scene) => {
const shape = CONFIG.CardSlotShape(); const shape = CONFIG.CardSlotShape();
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
const slot = BABYLON.MeshBuilder.CreateBox(`magic${i}`, shape, scene); const slot = BABYLON.MeshBuilder.CreatePlane(`magic${i}`, shape, scene);
// 位置 // 位置
slot.position = new BABYLON.Vector3( slot.position = new BABYLON.Vector3(
left + gap * i, left + gap * i,
...@@ -18,7 +18,10 @@ export default (scene: BABYLON.Scene) => { ...@@ -18,7 +18,10 @@ export default (scene: BABYLON.Scene) => {
slot.rotation = CONFIG.CardSlotRotation(); slot.rotation = CONFIG.CardSlotRotation();
// 材质 // 材质
const magicMaterial = new BABYLON.StandardMaterial("magicMaterial", scene); const magicMaterial = new BABYLON.StandardMaterial("magicMaterial", scene);
magicMaterial.diffuseColor = CONFIG.MagicColor(); magicMaterial.diffuseTexture = new BABYLON.Texture(
`http://localhost:3030/images/card_slot.png`
);
magicMaterial.diffuseTexture.hasAlpha = true;
slot.material = magicMaterial; slot.material = magicMaterial;
} }
}; };
...@@ -7,7 +7,7 @@ export default (scene: BABYLON.Scene) => { ...@@ -7,7 +7,7 @@ export default (scene: BABYLON.Scene) => {
const shape = CONFIG.CardSlotShape(); const shape = CONFIG.CardSlotShape();
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
const slot = BABYLON.MeshBuilder.CreateBox(`monster${i}`, shape, scene); const slot = BABYLON.MeshBuilder.CreatePlane(`monster${i}`, shape, scene);
// 位置 // 位置
slot.position = new BABYLON.Vector3( slot.position = new BABYLON.Vector3(
left + gap * i, left + gap * i,
...@@ -21,7 +21,10 @@ export default (scene: BABYLON.Scene) => { ...@@ -21,7 +21,10 @@ export default (scene: BABYLON.Scene) => {
"monsterMaterial", "monsterMaterial",
scene scene
); );
monsterMaterial.diffuseColor = CONFIG.MonsterColor(); monsterMaterial.diffuseTexture = new BABYLON.Texture(
`http://localhost:3030/images/card_slot.png`
);
monsterMaterial.diffuseTexture.hasAlpha = true;
slot.material = monsterMaterial; slot.material = monsterMaterial;
} }
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment