• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Minor Help with Carousel selection menu?

A

Aetrix

Guest
Hello to all, I have been watching this video ( just put "youtube com" here---> /watch?v=yWhqLR20RXU&t=121s) and if anyone can help me with only one thing, I wanna hide all sprites that are in the back and always show only the front ones? I did manage to get this working but I have only this one problem where I'm not able to hide the back ones. i did this if "if(item == i || item == i - 1 || item == i + 1 || item == i - 2 || item == i + 2 )" and it works ok but it doesn't show 9 and 10 item if index is 0 and it doesn't show 1 and 2 if item index is end of queue. I can share my project if anyone wanna try...
 

Xer0botXer0

Senpai
here each sub-image of oMenu is being drawn every frame from what I can see..






Under the draw event:
GML:
selected_item = image_number/2;
repeat(image_number)
{
    i = ds_priority_delete_min(pr);
    if i < selected_item - 3 || i > selected_item + 3
    {
        //These won't draw
    } else
        // drawing code here.. (that's visible in video)
    {
}
}

Not sure if it'll work but give it a go.
 
A

Aetrix

Guest
Thank you for your reply but it didn't work.

GML:
selected_item = image_number/2;
repeat(image_number)
{
    if i < selected_item - 3 || i > selected_item + 3
    {

    }
    else
    {
          draw_sprite_ext(sprite_index,
          i,menu_x+lengthdir_x(menu_width/2,(rot-90)+i*(360/image_number)),
          menu_y+lengthdir_y(menu_height/2,(rot-90)+i*(360/image_number)),
          1+lengthdir_y(menu_height/2,(rot-90)+i*(360/image_number))/(menu_height*2),
          1+lengthdir_y(menu_height/2,(rot-90)+i*(360/image_number))/(menu_height*2),0,c_white,1);
     }
}
but is still don't see 2 end elements if I'm at index (item ) 0 and I don't see first 2 elements if I'm at the end (last index in queue).

as far as I understand this I need to know when am at the beginning of a list and at the end. When on the beginning I need to draw the same amount that I have on the right side but that will be end elements in a list. when I'm at the beginning I need to draw 9,10,0,1,2 elements because 0 is first/selected and when I'm at the end I need to draw 8,9,10,0,1 because 10 is now center element.
 
Last edited by a moderator:
Top