Currently to open the link i am using button sprite. But now i want to link a text to website. Is there any way to do this in AndEngine?
1 Answer
\$\begingroup\$
\$\endgroup\$
Make the link clickable and then go to url using intent.
Text link = new Text(100, 100, this.mFont, "Link", this.getVertexBufferObjectManager()){
@Override
public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
switch(pSceneTouchEvent.getAction()) {
case TouchEvent.ACTION_DOWN:
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("http://www.google.com"));
startActivity(i);
break;
}
return true;
}
};