How would I go about making a cursor that always moves back and forth on the highlighted option? I already have a working menu with a cursor that is still but how would I make a cursor that moves?
Thanks for the reply.
No, I'm using my own graphical menus for user input. I have the menu part all set with the cursor that doesn't move and I am able to move it between positions in the menu ok, it's just that I'm trying to have my cursor move back and forth at the current option it is highlighting.
//Verify it's in a valid range
nCursorPos = (nCursorPos & 0x7fff) % nTotalOptions;
DrawHighlightedMenuOption(nCursorPos);
I just have two questions:
What does the first line do with the bit manipulation?
How does DrawHighlightedMenuOption(nCursorPos) work? (That's the main part I'm confused about)
Thanks for the help.
Well, for DrawHighlightedMenuOption() I want to try and have a cursor that is pointing to a menu item (let's say for example the last option) and then it will move back and forth while on that option like this:
Option 1
Option 2
-> Option 3
Option 1
Option 2
-> Option 3
Option 1
Option 2
-> Option 3
All the cursor will do is while it is highlighting a menu option, it will move back and forth just as like a simple animation in a way.
Then you can just draw your cursor using XOR effect, so that it reverts the destination region. Drawing a second time your cursor at the same place will erase it (double reverse).
So, in a loop, you draw your cursor at a x,y place, you wait a bit, and you redraw it at the same place, and cycle the loop with different x (horizontal) values, adding to x values cycled in a table like this for example {-1, -1, 0, 1, 1, 1, 0, -1}. It will be drawn at a different place each loop cycle, thus giving the impression of being animated.
That sounds like a great idea! Thanks for the help, I'll try that out as soon as I can.