Search in sources :

Example 1 with OutLineActor

use of var3d.net.center.shaderActor.OutLineActor in project var3dframe by Var3D.

the class StageTest method init.

@Override
public void init() {
    // 设置背景
    setBackground(R.image.bg);
    // 设置标题
    txt_logo = game.getLabel(R.strings.logo).setColor(Color.BLUE).setStroke(Color.CYAN).setPosition(getWidth() / 2, getHeight() - 20, Align.top).setAlpha(0.9f).touchOff().show();
    // Tost
    btn_tost = game.getButton(R.image.pause_btn_bg).setPosition(0, 380).addClicAction().show();
    btn_tost.add(game.getLabel(R.strings.tost).getActor());
    btn_tost.addListener(new ClickListener() {

        public void clicked(InputEvent event, float x, float y) {
            game.setUserData(DialogMessge.MODEL, new DialogMessge.Model("这是一个Tost范例"));
            game.showDialog(DialogMessge.class);
        }
    });
    // 自定义对话框
    btn_dialog = game.getButton(R.image.pause_btn_bg).setPosition(0, 320).addClicAction().show();
    btn_dialog.add(game.getLabel(R.strings.dialogTitle).getActor());
    btn_dialog.addListener(new ClickListener() {

        public void clicked(InputEvent event, float x, float y) {
            game.showDialog(DialogTest.class);
        }
    });
    // shader测试
    WaterActor waterActor = game.getUI(new WaterActor(game.getTextureRegion(R.image.badlogic))).show(Align.center);
    OutLineActor outLineActor = game.getUI(new OutLineActor(game.getTextureRegion(R.image.tank_4))).setPosition(getWidth() / 2, waterActor.getY() - 10, Align.top).show();
}
Also used : DialogMessge(var3d.net.center.DialogMessge) WaterActor(var3d.net.center.shaderActor.WaterActor) OutLineActor(var3d.net.center.shaderActor.OutLineActor) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 DialogMessge (var3d.net.center.DialogMessge)1 OutLineActor (var3d.net.center.shaderActor.OutLineActor)1 WaterActor (var3d.net.center.shaderActor.WaterActor)1