This content has been marked as final. Show 7 replies
Hmmm ... maybe it's just me but I'm not exactly following what you're trying to do. Do you want a drop down menu with items that change on the fly? A set of buttons whose labels change? Some more detail might help.
What I'm trying to do is a screen menu that the user clicks on or presses a letter on the keyboard. Continue (If game in progress), New Game, Load Game, Save Game (If game in progress) and so on.
I want the menu to be readable by screen readers and/or easily converted to speech via SAPI.
I've been playing with lists, but having issues converting it to text. I've been out doing 3D modelling to much!
Does that help?
William D. Hascall
Lol, that helps but I’m afraid I don’t know what the requirements are for the screen readers or SAPI … if all it takes is a string that you can send to SAPI for speech conversion it shouldn’t be too hard to get the string.
A down and dirty method would be to loop through all sprites and assemble the string using the text property of text sprites and the member name for bitmaps (you’d have to name your members to make sense when spoken), when you get to the last sprite send the string to SAPI
A much more elegant method would be a behavior that stores the speech text equivalent for each sprite in a property variable; the behavior would return that text string when called either by a key press event (ie, user initiated) or when polled by another handler (lingo initiated). Changing the speech text on the fly shouldn’t be any problem, for example if a sprite contained the score just read the text property of the member into the speech text variable. If you want to read the entire screen just call all sprites and concatenate the strings returned from each … if you want a menu item to announce it has changed without reading the entire screen the handler causing the change could send the speech text.
Yes, to activate SAPI, you just send it a string. What I wanted to do was to make the menu a string too, or a list, that would appear like a menu. I might do the sprite concept later. I would like to get this working for now just to get the thing working. Here is the menu code as I have it now:
-> Start Lingo
menuList = 
if (gameInProgress) then
appendLine = "C: Continue Game"
appendLine = "N: New Game"
appendLine = "L: Load Game"
if (gameInProgress) then
appendLine = "S: Save Game"
appendLine = "O: Options"
appendLine = "A: About and Credits"
appendLine = "Q: Quit"
member("Main Menu Display Text").text = menuList
member("Main Menu Spoken Text").text = menuList
<- Stop Lingo
This, of course, crashed on me. I tried using value() too which gave me the same error. Thought I read somewhere that something like this could work.
If I have to break the menu up into elements and concatinate them, then, I guess I wll.
Thanks for the help!
Yeah, you can can’t automatically convert a list of strings to a simple string but it’s not hard to write a function to do it for you. Try this:
Change the member lines to this:
Member(“Main Menu Display Text “).text = list2string(menuList)
Member(“Main Menu Spoken Text “).text = list2string(menuList)
Then put the following script in a MOVIE script. This function simply loops through the strings in your list and returns the fully concatenated string:
This would be better, it will prevent the leading space:
Thank you very much for your help. I believe that this will greatly help me.