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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
love_飞影
Neos
Commits
49e2424b
Commit
49e2424b
authored
Dec 10, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize button texture
parent
77623173
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
src/config/ui.ts
src/config/ui.ts
+1
-1
src/ui/Duel/simpleDuel/hands.ts
src/ui/Duel/simpleDuel/hands.ts
+9
-4
No files found.
src/config/ui.ts
View file @
49e2424b
...
@@ -62,7 +62,7 @@ export const HandHoverOutScaling = () => {
...
@@ -62,7 +62,7 @@ export const HandHoverOutScaling = () => {
return
new
BABYLON
.
Vector3
(
1
,
1
,
1
);
return
new
BABYLON
.
Vector3
(
1
,
1
,
1
);
};
};
export
const
HandInteractShape
=
()
=>
{
export
const
HandInteractShape
=
()
=>
{
return
{
width
:
0.
4
,
height
:
0.1
};
return
{
width
:
0.
8
,
height
:
0.2
};
};
};
export
const
HandInteractFontSize
=
300
;
export
const
HandInteractFontSize
=
300
;
...
...
src/ui/Duel/simpleDuel/hands.ts
View file @
49e2424b
...
@@ -65,16 +65,21 @@ function setupHandInteractivity(
...
@@ -65,16 +65,21 @@ function setupHandInteractivity(
scene
scene
);
);
interact
.
parent
=
mesh
;
interact
.
parent
=
mesh
;
interact
.
position
.
x
=
CONFIG
.
HandShape
().
width
/
2
+
interactShape
.
width
/
2
;
// 调整位置
interact
.
translate
(
new
BABYLON
.
Vector3
(
0
,
1
,
0
),
CONFIG
.
HandShape
().
height
/
2
+
interactShape
.
height
/
2
);
const
advancedTexture
=
const
advancedTexture
=
BABYLON_GUI
.
AdvancedDynamicTexture
.
CreateForMesh
(
interact
);
BABYLON_GUI
.
AdvancedDynamicTexture
.
CreateForMesh
(
interact
);
const
button
=
BABYLON_GUI
.
Button
.
Create
Simple
Button
(
const
button
=
BABYLON_GUI
.
Button
.
Create
ImageWithCenterText
Button
(
`handInteractButtion
${
handIdx
}
`
,
`handInteractButtion
${
handIdx
}
`
,
"
test
"
"
test
"
,
"
http://localhost:3030/images/interact_button.png
"
);
);
button
.
fontSize
=
CONFIG
.
HandInteractFontSize
;
button
.
fontSize
=
CONFIG
.
HandInteractFontSize
;
button
.
background
=
"
gray
"
;
button
.
color
=
"
white
"
;
button
.
onPointerClickObservable
.
add
(()
=>
{
button
.
onPointerClickObservable
.
add
(()
=>
{
console
.
log
(
`<Interact>hand
${
handIdx
}
`
);
console
.
log
(
`<Interact>hand
${
handIdx
}
`
);
});
});
...
...
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