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

2014/3/8

GreenfootSound setVolume

Nitrouspiggy Nitrouspiggy

2014/3/8

#
I have a piece of code that sets UserInfo int 1 to a value between 0 and 99. I then have this code,
UserInfo ui = UserInfo.getMyInfo();
        if(ui!=null)
        {
            music.setVolume(ui.getInt(1));
        }
        else music.setVolume(50);
that supposedly sets my music volume to that integer. However, when i change this value the volume the music changes to seems to be completely random. It is sometimes loudest at ≈20 and sometimes at ≈50, while it is completely silent at both 0 and 99 values. I have no idea why this does not work as i know that the slider that sets the value outputs the correct value when I click save. What's going on here?
Nitrouspiggy Nitrouspiggy

2014/3/8

#
Wait nevermind. I was setting the volume before i saved the settings, so it was doing the previous value each time. Silly me.
You need to login to post a reply.