Libgdx对话框没有显示文本

时间:2017-03-08 14:37:05

标签: text libgdx dialog label

我有Dialog LabelTextButtonTextButton显示正确,但我看不到Label文字。但是,如果Dialog中的文字较长,则Label会变大,如果文字较短,则会变小。

我使用的代码:

Dialog dialog = new Dialog("Warning", uiSkin) {
                            public void result(Object obj) {
                                System.out.println("result "+obj);
                            }
                        };
Label warningLabel = new Label("Invalid data", uiSkin);
dialog.text(warningLabel);
dialog.setMovable(false);
TextButton warningButton = new TextButton("OK", uiSkin, "small");
dialog.button(warningButton);
dialog.key(Keys.ENTER, true); 
if(!password.getText().equals(passwordRepeat.getText())){
                            dialog.show(signupStage);
                        }

0 个答案:

没有答案