|
Post by johnno56 on Apr 17, 2022 22:16:59 GMT -6
Attempt to convert my sdlbasic version of a simple(?) carousel menu(?). SDLBasic uses a bobz() system where the images can be drawn in 'layers' for want of a better word. First test is just getting the images on the screen and controlled by the left and right arrows. Without control of the "print order" of the images, the images, seem to move in a "figure eight" pattern... I think that is what it is called.... Co-ordinates of each image is also displayed. Suggested methods of how to replicate the correct "print order" would be appreciated (see attached sdlbasic screenshot) carousel01.zip (208.95 KB)
|
|
|
Post by rosy on Apr 22, 2022 15:02:50 GMT -6
You just change the order in which the pictures are displayed ... Or make 2 canvases separately for the bottom and top pictures.
|
|
marcus_forgot_his_pwd
Guest
|
Post by marcus_forgot_his_pwd on Apr 24, 2022 7:18:46 GMT -6
If all the "sprites" are in a fixed array and the rotation is an angle offset that affects all the sprites, it should just be a matter of finding the index of the sprite to draw first and loop through the array from there. No need for sorting or anything.
|
|
marcus_forgot_his_pwd
Guest
|
Post by marcus_forgot_his_pwd on Apr 24, 2022 7:21:02 GMT -6
Forget about that comment, wasn't thinking straight.
|
|
marcus_forgot_his_pwd
Guest
|
Post by marcus_forgot_his_pwd on Apr 24, 2022 7:27:43 GMT -6
You could find the index of the sprite farthest away (closest to 12 o clock) and then step through the array in both directions at the same time
|
|
|
Post by johnno56 on Apr 24, 2022 15:28:40 GMT -6
Hi Marcus,
I can handle basic arrays. Define them; Fill or clear them; Display them... "Stepping through... in both directions", knowing how to do that, to me anyway, reminds me of an area between two combatants in World War 1... "No man's land"... I have no idea how to manipulate arrays like that... How about a nice game of Pong? lol
|
|
|
Post by rosy on Apr 25, 2022 3:37:22 GMT -6
What's wrong with the first idea?
|
|
|
Post by johnno56 on Apr 25, 2022 4:05:53 GMT -6
My knowledge of arrays is quite limited... That is why I preferred to have the carousel created using sdlbasic. Because sdlbasic could place the images on the screen automatically based on their level of "depth". I would like to recreate the program with RC but I do not know how.
"Change the order" and "make 2 canvases" and "finding the index of a sprite" and "step through the array in both directions" are all fine instructions... all instructions given are assuming that I have the know-how to convert all or some of them to code...
I am going to make this easier for all concerned... as much as I appreciate the help, it is plainly obvious, that my "grasp has exceeded my reach".. again... I think I will turn my attention to something else and leave this one "on the shelf" until a later date.
|
|
J7M
New Member
Posts: 18
|
Post by J7M on Apr 26, 2022 12:11:02 GMT -6
here a simple version with z-sorting. Neither elegant nor fast but functional. I hope it works well, sometime I get headache with array if they start with 0 or 1 and how many elements you need... Attachments:Carousel.zip (216.38 KB)
|
|