HOW to display wait cursor while display! (NON BLOCKING DISPLAY)

Started by Gazzo, Sun 19/07/2009 09:41:24

Previous topic - Next topic

Gazzo

HEY! is there a way to display the wait cursor, in "display" text too? just like in speech?
--------------------------EDIT------------------------------------------
I DISCOVERED the real problem, is there a way to make the "display" non blocking? like speech ???  speech lets animation still happen in background while display doesn't!!!HELP!
(*---\- \ Adolfo Gazzo / -/---*)

Khris

Why didn't you put this in the other thread about the exact same topic...?

Gazzo

hehe sorry :P!! i'm going to continue on this one, well i doesn't change the cursor to the wait cursor. i kinda don't like visualy that when my character is speaking with the narrator (display text) the cursor constantly changes from wait to the previous one, i know i could make the narrator a character that follows the player to every room but i've allready scripted lots of dialog and don't want to change all my display texts for speech :P
(*---\- \ Adolfo Gazzo / -/---*)

Galen

I guess technically you make use of the cutscene feature?

GuyAwesome

You could try setting the current cursor mode's graphic to the Wait graphic before Display commands, and then back afterwards
Code: ags

mouse.UseModeGraphic(eModeWait);
Display("Look at me!");
mouse.UseDefaultGraphic();


('displaying a "wait" cursor temporarily' is actually the example given for UseModeGraphic in the manual.) It might get fiddle-y to do it for every single line, but for longer 'conversations' between the narrator and the PC it'd at least avoid the cursor switching back and forth. (You could write a custom function to handle it instead of using Display - but then you'd have to change every line you've already written.) A similar work around would be to use mouse.Visible to turn the cursor off during those exchanges.

Changing Display commands to cNarrator.Say (or a custom function as mentioned above) would mostly be a simple case of find-and-replace. The only exception I can think of is if you're displaying variables in the text (Display("You have %d gold." player.InvetoryQuantity[iGold.ID]);), in which case you'll need to use String.Format: cNarrator.Say(String.Format("You have %d gold." player.InventoryQuantity[iGold.ID]));. So, a bit of work, but not quite as bad as having to re-write everything. (And a Character doesn't have to be in the current room to speak, AFAIK, so you don't need to worry about making them follow the player.) Of course, it's a matter of preference, too - I think the Display box would look better than disembodied Character speech, but that might just be me...

Galen

You would probably want to store the user's current cursor in a variable/pointer (I've never delved that deep with ags) before you run that script. Having mouse-modes changed automatically can get annoying.

GuyAwesome

Nope, no need. This is pretty much exactly what UseModeGraphic was made for - it doesn't change the mode, just the graphic - and UseDefaultGraphic sets it back to normal. No need to store the 'normal' graphic or anything, provided you use both commands.
Now, if you wanted to set eModeWaits cursor to the current mode and back again you'd need a variable, something like
Code: ags

int TempCursor = mouse.GetModeGraphic(eModeWait); // Store eModeWait graphic
mouse.ChangeModeGraphic(eModeWait, mouse.GetModeGraphic(mouse.Mode)); // Change eModeWait to current mode graphic
DIsplay("Hello.");
mouse.ChangeModeGraphic(eModeWait, TempCursor); // Change eModeWait to current mode graphic


Personally I don't think that'd look as good, though. Still, matter of preference.

Gazzo

hey!thanx for the help, it's probably the only way to do it, hmm well at least it's just one extra line before the display and one after, maybe i'll change the displays for speech ant position what the narrator (new cahracter says) at the bottom (y =170) . Well thanks for the help!!
(*---\- \ Adolfo Gazzo / -/---*)

SMF spam blocked by CleanTalk