Skip to content
Snippets Groups Projects
Commit 79655466 authored by Frantisek Simon's avatar Frantisek Simon
Browse files

#62 Dialog refactoring - more simple create dialog methods

parent b7588884
No related merge requests found
......@@ -24,21 +24,16 @@ public class DialogFactory {
return createBubbleDialog(text, screenSize.x / 2 - width / 2, screenSize.y / 2 - height / 2, width, height);
}
public static TextDialog createBubbleDialog(String text, float x, float y, float width, float height) {
TextDialog dialog = new TextDialog(x, y, width, height, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC, new DialogTextContent(text));
return dialog;
public static TextDialog createBubbleContinueDialog(String text) {
return createTextDialog(text, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC_CONTINUE_BUTTON);
}
public static TextDialog createBubbleContinueDialog(String text) {
final Point screenSize = new Point(TablexiaSettings.getWorldWidth(),TablexiaSettings.getMinWorldHeight());
int width = DEFAULT_DIALOG_WIDTH;
int height = DEFAULT_DIALOG_HEIGHT;
return createBubbleContinueDialog(text, screenSize.x / 2 - width / 2, screenSize.y / 2 - height / 2, width, height);
public static TextDialog createSquerBorderlessDialog(String text) {
return createTextDialog(text, TablexiaDialog.BackGroundType.DIALOG_SQUARE);
}
public static TextDialog createBubbleContinueDialog(String label, float x, float y, float width, float height) {
TextDialog dialog = new TextDialog(x, y, width, height, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC_CONTINUE_BUTTON, new DialogTextContent(label));
return dialog;
public static TextDialog createSquerBorderDialog(String text) {
return createTextDialog(text, TablexiaDialog.BackGroundType.DIALOG_SQUARE_BORDERLINES);
}
public static ImageDialog createImageDialog(TextureRegion texture) {
......@@ -49,8 +44,25 @@ public class DialogFactory {
return dialog;
}
public static TextDialog createBubbleContinueDialog(String label, float x, float y, float width, float height) {
TextDialog dialog = new TextDialog(x, y, width, height, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC_CONTINUE_BUTTON, new DialogTextContent(label));
return dialog;
}
public static DynamicBubbleDialog createDynamicBubbleDialog(String text, float x, float y, float width, float height, float bubbleArrowOffsetX) {
DynamicBubbleDialog dialog = new DynamicBubbleDialog(x, y, width, height, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC_PURE, new DialogTextContent(text), bubbleArrowOffsetX);
return dialog;
}
public static TextDialog createBubbleDialog(String text, float x, float y, float width, float height) {
TextDialog dialog = new TextDialog(x, y, width, height, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC, new DialogTextContent(text));
return dialog;
}
private static TextDialog createTextDialog(String text, TablexiaDialog.BackGroundType backGroundType) {
final Point screenSize = new Point(TablexiaSettings.getWorldWidth(),TablexiaSettings.getMinWorldHeight());
int width = DEFAULT_DIALOG_WIDTH;
int height = DEFAULT_DIALOG_HEIGHT;
return new TextDialog(screenSize.x / 2 - width / 2, screenSize.y / 2 - height / 2, width, height, backGroundType, new DialogTextContent(text));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment