Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public UIElement button(Player player, String Attribute, float fontsize, String text, boolean clickable){
- int color = 0xFFffffff;
- if(clickable==false){
- color = 0x808080ff;
- }
- //button
- UIElement Button = new UIElement();
- Button.setPivot(Pivot.MiddleCenter);
- Button.setBorderColor(color);
- Button.setBorder(2);
- Button.setBorderEdgeRadius(15, false);
- Button.setVisible(true);
- Button.setClickable(clickable);
- Button.setPickable(true);
- //button text
- UILabel ButtonText = new UILabel();
- ButtonText.setText(text);
- ButtonText.setFontSize(fontsize);
- ButtonText.setFontColor(color);
- ButtonText.setPivot(Pivot.MiddleCenter);
- ButtonText.setPosition(50, 50, true);
- ButtonText.setSize(90, 90, true);
- ButtonText.setVisible(true);
- Button.addChild(ButtonText);
- player.setAttribute(Attribute+"_ButtonText", ButtonText);
- player.setAttribute(Attribute+"_Button", Button);
- return Button;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement