📄 credit.java
字号:
import objectdraw.*;import java.awt.*;public class Credit extends ActiveObject { private static final int Y_SPEED = 4; private static final int DELAY_TIME = 100; private Text roleAndName; // information to be displayed public Credit(String scrollingLine, DrawingCanvas canvas) { // create the line to be displayed roleAndName = new Text(scrollingLine, 0, canvas.getHeight(), canvas); // center it on the canvas roleAndName.move((canvas.getWidth() - roleAndName.getWidth())/2, 0); // start the movement start(); } public void run() { // move up while any part of the credit line is visible while (roleAndName.getY() > -roleAndName.getHeight()) { roleAndName.move(0, -Y_SPEED); pause(DELAY_TIME); } roleAndName.removeFromCanvas(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -