use of com.watabou.noosa.Text in project pixel-dungeon-remix by NYRDS.
the class AboutScene method createTouchLink.
private Text createTouchLink(final String address, Text visit) {
Text text = createText(address, visit);
text.hardlight(Window.TITLE_COLOR);
TouchArea area = new TouchArea(text) {
@Override
protected void onClick(Touch touch) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(address));
Game.instance().startActivity(Intent.createChooser(intent, OUR_SITE));
}
};
add(area);
return text;
}
use of com.watabou.noosa.Text in project pixel-dungeon-remix by NYRDS.
the class AboutScene method createText.
private Text createText(String text, Text upper) {
Text multiline = createMultiline(text, GuiProperties.regularFontSize());
multiline.maxWidth(Camera.main.width * 5 / 6);
multiline.measure();
add(multiline);
if (upper != null) {
placeBellow(multiline, upper);
}
return multiline;
}
use of com.watabou.noosa.Text in project pixel-dungeon-remix by NYRDS.
the class AboutScene method createTouchEmail.
private Text createTouchEmail(final String address, Text text2) {
Text text = createText(address, text2);
text.hardlight(Window.TITLE_COLOR);
TouchArea area = new TouchArea(text) {
@Override
protected void onClick(Touch touch) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("message/rfc822");
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { address });
intent.putExtra(Intent.EXTRA_SUBJECT, Game.getVar(R.string.app_name));
Game.instance().startActivity(Intent.createChooser(intent, SND));
}
};
add(area);
return text;
}
use of com.watabou.noosa.Text in project pixel-dungeon-remix by NYRDS.
the class AboutScene method create.
@Override
public void create() {
super.create();
Text text = createText(getTXT(), null);
text.camera = uiCamera;
text.x = align((Camera.main.width - text.width()) / 2);
text.y = align((Camera.main.height - text.height()) / 3);
Text email = createTouchEmail(Game.getVar(R.string.AboutScene_Mail), text);
Text visit = createText(Game.getVar(R.string.AboutScene_OurSite), email);
Text site = createTouchLink(LNK, visit);
createText("\n" + getTRN(), site);
Image nyrdie = Icons.NYRDIE.get();
nyrdie.x = align(text.x + (text.width() - nyrdie.width) / 2);
nyrdie.y = text.y - nyrdie.height - 8;
add(nyrdie);
new Flare(7, 64).color(0x332211, true).show(nyrdie, 0).angularSpeed = -20;
Archs archs = new Archs();
archs.setSize(Camera.main.width, Camera.main.height);
addToBack(archs);
ExitButton btnExit = new ExitButton();
btnExit.setPos(Camera.main.width - btnExit.width(), 0);
add(btnExit);
fadeIn();
}
use of com.watabou.noosa.Text in project pixel-dungeon-remix by NYRDS.
the class AllowStatisticsCollectionScene method create.
@Override
public void create() {
super.create();
Text title = createMultiline(TTL_Welcome, GuiProperties.bigTitleFontSize());
int w = Camera.main.width;
int h = Camera.main.height;
int pw = w - 10;
title.maxWidth(pw);
title.measure();
title.x = align((w - title.width()) / 2);
title.y = align(8);
add(title);
NinePatch panel = Chrome.get(Chrome.Type.WINDOW);
panel.x = (w - pw) / 2;
panel.y = title.y + title.height() + GAP * 2;
int ph = (int) (h - panel.y - 22);
panel.size(pw, ph);
add(panel);
ScrollPane list = new ScrollPane(new Component());
add(list);
list.setRect(panel.x + panel.marginLeft(), panel.y + panel.marginTop(), panel.innerWidth(), panel.innerHeight());
list.scrollTo(0, 0);
Component content = list.content();
content.clear();
float yPos = 0;
Text text = createMultiline(Game.getVar(R.string.AllowStatisticsCollectionScene_Request), GuiProperties.regularFontSize());
text.maxWidth((int) panel.innerWidth());
text.measure();
content.add(text);
yPos += text.height() + GAP;
content.setSize(panel.innerWidth(), yPos);
RedButton allow = new RedButton(Game.getVar(R.string.AllowStatisticsCollectionScene_Allow)) {
@Override
protected void onClick() {
Preferences.INSTANCE.put(Preferences.KEY_COLLECT_STATS, 100);
Game.instance().initEventCollector();
Game.switchScene(TitleScene.class);
}
};
RedButton deny = new RedButton(Game.getVar(R.string.AllowStatisticsCollectionScene_Deny)) {
@Override
protected void onClick() {
Preferences.INSTANCE.put(Preferences.KEY_COLLECT_STATS, -100);
Game.instance().initEventCollector();
Game.switchScene(TitleScene.class);
}
};
allow.setRect((w - pw) / 2, h - 22, pw / 2 - GAP, 18);
deny.setRect((w - pw) / 2 + pw / 2, h - 22, pw / 2 - GAP, 18);
add(allow);
add(deny);
Archs archs = new Archs();
archs.setSize(Camera.main.width, Camera.main.height);
addToBack(archs);
fadeIn();
}
Aggregations