This site requires JavaScript, please enable it in your browser!
Greenfoot back
Spilli
Spilli wrote ...

2012/4/3

Getting some basic user information

Spilli Spilli

2012/4/3

#
I was wondering if there is anyway my Greenfoot scenario can get basic information from the logged in user. This information would include stuff like: * Username * Path to user-image And maybe more which isn't very personal and can be view on the users profile.
nccb nccb

2012/4/3

#
Yes: 1. Download the Greenfoot 2.2.0 beta (or wait for 2.2.0 release) 2. Use this code:
PlayerData currentUser = PlayerData.getMyData();
if (currentUser != null)
{
    String userName = currentUser.getUserName();
    GreenfootImage userImage = currentUser.getUserImage();
}
Spilli Spilli

2012/4/3

#
Great, thanks for the help, much appreciated.
You need to login to post a reply.