Search in sources :

Example 1 with BallWidget

use of gregtech.common.terminal.app.game.pong.widget.BallWidget in project GregTech by GregTechCEu.

the class PongApp method initApp.

@Override
public AbstractApplication initApp() {
    if (isClient) {
        paddles = new ArrayList<>();
        solidObjects = new ArrayList<>();
        this.addWidget(new ImageWidget(5, 5, 333 - 10, 232 - 10, TerminalTheme.COLOR_B_2));
        this.addWidget(new ImageWidget(333 / 2 - 4, 5, 6, 232 - 10, new ColorRectTexture(0xAAAAAAAA)));
        this.setBall(new BallWidget(333 / 2 - 1, 232 / 2 - 1));
        this.addWidget(new SimpleTextWidget(50, 20, "", 0xAAAAAA, () -> String.valueOf(this.getScore(true)), true));
        this.addWidget(new SimpleTextWidget(283, 20, "", 0xAAAAAA, () -> String.valueOf(this.getScore(false)), true));
        this.initPaddles();
    }
    return this;
}
Also used : ColorRectTexture(gregtech.api.gui.resources.ColorRectTexture) BallWidget(gregtech.common.terminal.app.game.pong.widget.BallWidget) ImageWidget(gregtech.api.gui.widgets.ImageWidget) SimpleTextWidget(gregtech.api.gui.widgets.SimpleTextWidget)

Aggregations

ColorRectTexture (gregtech.api.gui.resources.ColorRectTexture)1 ImageWidget (gregtech.api.gui.widgets.ImageWidget)1 SimpleTextWidget (gregtech.api.gui.widgets.SimpleTextWidget)1 BallWidget (gregtech.common.terminal.app.game.pong.widget.BallWidget)1