添加提示入场效果,为消失效果增加动画曲线
This commit is contained in:
parent
1e43edb821
commit
8145ab4db3
1 changed files with 10 additions and 5 deletions
|
@ -92,13 +92,17 @@ public class KillMessageOverlay {
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO 实现图标半透明渲染
|
// TODO 实现图标半透明渲染
|
||||||
// TODO 实现入场效果
|
|
||||||
// TODO 实现非线性动画
|
// 入场效果
|
||||||
|
if (record.tick < 3) {
|
||||||
|
gui.pose().translate((3 - record.tick - event.getPartialTick()) * 33, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// 4s后开始消失
|
// 4s后开始消失
|
||||||
if (record.tick >= 80) {
|
if (record.tick >= 80) {
|
||||||
gui.pose().translate((-80 + record.tick + event.getPartialTick()) * 5, 0, 0);
|
double rate = Math.pow((record.tick + event.getPartialTick() - 80) / 20, 5);
|
||||||
// 时间越久图片越透明
|
gui.pose().translate(rate * 100, 0, 0);
|
||||||
gui.setColor(1, 1, 1, (100 - (-80 + record.tick + event.getPartialTick()) * 5f) / 100f);
|
gui.setColor(1, 1, 1, (float) (1 - rate));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 击杀提示是右对齐的,这里从右向左渲染
|
// 击杀提示是右对齐的,这里从右向左渲染
|
||||||
|
@ -202,6 +206,7 @@ public class KillMessageOverlay {
|
||||||
RenderSystem.depthMask(true);
|
RenderSystem.depthMask(true);
|
||||||
RenderSystem.enableDepthTest();
|
RenderSystem.enableDepthTest();
|
||||||
|
|
||||||
|
gui.setColor(1, 1, 1, 1);
|
||||||
gui.pose().popPose();
|
gui.pose().popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue