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

2020/10/30

jukebox or album music

ronald ronald

2020/10/30

#
public class Background extends World
{

    /**
     * Constructor for objects of class MyWorld.
     * 
     */
    
    
    
    public Background()
    {    
        // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
        super(900, 600, 1); 
        String bgTxt=("ARIANA GRANDE - DANGEROUS WOMAN (2016)");
        GreenfootImage img = new GreenfootImage(bgTxt, 30, Color.WHITE, Color.BLUE);
        GreenfootImage bg = getBackground();
        bg.drawImage(img, (bg.getWidth()-img.getWidth())/4, (bg.getHeight()-img.getHeight())/6);
        
        bg.setColor(Color.BLUE);
        //bg.drawString("ARIANA GRANDE - DANGEROUS WOMAN (2016)",50,100);
        
        bg.drawString("01 - Moonlight",50,150);
        bg.drawString("02 - Dangerous Woman",50,175);
        bg.drawString("03 - Be Alright",50,200);
        bg.drawString("04 - Into You",50,225);
        bg.drawString("05 - Side To Side",50,250);
        bg.drawString("06 - Let Me Love You",50,275);
        bg.drawString("07 - Greedy",50,300);
        bg.drawString("08 - Leave Me Lonely",50,325);
        bg.drawString("09 - Everyday",50,350);
        bg.drawString("10 - Sometimes",50,375);
        bg.drawString("11 - I Don't Care",50,400);
        bg.drawString("12 - Bad Decisions",50,425);
        bg.drawString("13 - Touch It",50,450);
        bg.drawString("14 - Knew Better/Forever Boy",50,475);
        bg.drawString("15 - Thinking Bout You",50,500);
    }
}
I'm trying to create a music album but I realize that there are many ways to create big characters in world I tried with String bgTxt, it works but is it the best solution?
danpost danpost

2020/10/30

#
If all you want to do is list the album songs with non-clickable, non-changeable, non-movable text, that is sufficient.
ronald ronald

2020/10/30

#
yes I think that is enough for me but I hesitate between bg.drawString and String bgTxt because afterwards I will create green bars and buttons play, pause and the number of song to listen to I looked at your bars to see how you did
ronald ronald

2020/10/30

#
I want to know how we make several green bars thank you
danpost danpost

2020/10/30

#
ronald wrote...
I want to know how we make several green bars thank you
What are they for?
ronald ronald

2020/10/30

#
for example, you choose the song number by clicking a button and when the song starts or ends the bar or bars do the same when the song is over, the bar is green as I have 15 songs, I need 15 bars plus a few buttons, play, sound ...
danpost danpost

2020/10/30

#
Okay, so like progress bars for the songs? Why one for each? -- will you be having more than one play at a time?
ronald ronald

2020/10/30

#
yes that's the progression bars for song I thought I would use for loop to make 15 bars of progressions I don't know if it's possible
danpost danpost

2020/10/30

#
ronald wrote...
yes that's the progression bars for song I thought I would use for loop to make 15 bars of progressions I don't know if it's possible
Sure it's possible. You might want to use an array of them.
ronald ronald

2020/10/30

#
must see, why not a table with for loop, I think I have to find out how to make a progress bar before something advice to make it happen?
danpost danpost

2020/10/31

#
ronald wrote...
must see, why not a table with for loop, I think I have to find out how to make a progress bar before something advice to make it happen?
You can find code to make a bar in my Value Display Tutorial scenario under: Non-textual display of a value >> A simple bar object And yes, a for loop would be best used to load the bar objects into the array. A useful second array will probably be one with the playing times of the songs (so the bars will "progress" at the appropriate speeds).
ronald ronald

2020/10/31

#
i will see what i can do and keep you posted thank you
You need to login to post a reply.