Show Face over Gui?

Started by Miori, Sat 29/11/2008 23:24:52

Previous topic - Next topic

Miori

I have a little Problem. I have a Line at the top and the bottom of the Screen. The bottom Line is for the Intventory and in the top Line you see the speech with Faceset.

Now i have a bigger room, it scrolls if you walk to the side. I want to make the lines as GUI, so it doesn't scroll too, but then i can't see the Faceset anymore. What should i do?

Screenshot from the Game:


Shane 'ProgZmax' Stevens

I have no idea what this Faceset thing you're referring to actually is, but if you want some non-gui items to update with the player's x (or y) position, just use the GetViewportX() and GetViewportY() functions to get the current viewport positions, then set whatever it is you're doing to that x (or y) value plus whatever offset you're using to place it.

subspark

Your not talking about setting the character to face a certain direction are you?

The manual describes the following:

Quote(Formerly known as global function FaceLocation, which is now obsolete)

Character.FaceLocation(int x, int y, optional BlockingStyle)

Similar to the FaceCharacter function, except that this faces the character to room co-ordinates (X,Y). This allows him to face not only other characters, but also hotspots or anything else as well (you can get co-ordinates by watching the co-ordinates displayed in the Room Settings mode as you move the mouse over the room background).
If the character has Turning enabled (ie. the "Characters turn to face direction" game option is turned on, and the character does not have the "Do not turn before walking" option checked), then the character will turn on the spot in order to face the new direction. In this case, the BlockingStyle parameter determines whether the script waits for the character to finish turning (eBlock, the default) or whether the script continues immediately and the character finishes turning later on (eNoBlock).

If the character does not have Turning enabled, he will immediately turn to face the new direction and the BlockingStyle parameter has no effect. In this case, the screen will not be refreshed straight away -- if you want to see the character facing his new direction immediately, call Wait(1);

Example:

cEgo.FaceLocation(cEgo.x + 50, cEgo.y);

will make the character face to the east.

Cheers,
Sparx.

Trent R

Faceset is probably referring to something similar to Facesets of RPGMaker, so dialogue pictures. But yeah Miori, try to be a bit more descriptive.

I'm guessing it's a probably with GUIs Z-orders, and that the dialogue text window GUI needs a higher Z-order than the lines GUIs.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Ryan Timothy B

I think he's trying to say that the top bar displays the characters speech text and picture.
But when he's walking in the scrolling room the speech text stays at the left side of the background if he walks right.

I haven't played around with speech gui's at all.  But I think you'll need to use GetViewportX() and GetViewportY() and add them to the speech GUI.x with the characters picture.

Miori

With faceset I meaned the speech picture.

The bars are part of the background graphic, but now i have a scrolling room, so the bars scroll too. But I don`t want this. I want to make the bars as a gui, the problem is, that then the speech picture is behind the gui, so I only see the text  :(


Trent R

What speech setting do you have? Lucas Arts? Sierra with no picture? Sierra with picture? Sierra with full portrait? (I think that's all)


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Miori

#7
I use Sierra with Picture and AGS 3.0

ciborium

#8
You should be able to set the z-order of the GUI to 0.  That is if the engine considers the Sierra Speech Overlay a GUI.   

Quote
ZOrder property

(Formerly known as SetGUIZOrder, which is now obsolete)

Code: ags

int GUI.ZOrder


Gets/sets the z-order of the GUI. This allows you to dynamically change the ordering of GUIs on the screen.

The Z-order setting is an arbitrary number between 0 and 1000. AGS draws the GUIs in order, from the lowest numbered at the back to the highest numbered at the front.

Example:

Code: ags

gStatusline.ZOrder = 0;


sets the STATUSLINE GUI to be behind all other GUIs.

See Also: GUI.GetAtScreenXY


Pumaman

You currently can't configure the z-order of standard sierra-style speech; probably the best bet would be to create the top and bottom borders as characters instead of GUIs, and have some code in repeatedly_Execute_always to keep them always in the current room and always aligned to the screen in scrolling rooms.

Miori

It is a good idea to make it as Charakter, but I don't know how to align it  always to the screen X_x . I have to put in in this function right?:

function room_RepExec()
{
}

But i don't know what to wright into it  ::) sry, it's the first game i make with AGS

Pumaman

putting something like this would do the trick:

cTopBanner.x = GetViewportX() - System.ViewportWidth / 2;
cTopBanner.y = GetViewportY() + (PUT HEIGHT OF BANNER HERE);

because character positions are specified at the bottom-middle, this script would maintain the character's image at the top-left of the screen.

I hope to add a feature to a future version of AGS to allow you to specify the Z-order of character speech, and avoid having to do a hack like this.

Miori

Thank you very much it works   :-*  ;D
But is it normal that it judders so much ?  ???

Pumaman

It's probably lagging behind the room by 1 frame. What you could do is, rather than using the built-in automatic scrolling, also do the scrolling yourself using SetViewport; that way you would be able to keep the two in sync.

Untested but something like this:

SetViewpoint(player.x - System.ViewportWidth / 2, player.y - System.ViewportHeight / 2);
cTopBanner.x = GetViewportX() - System.ViewportWidth / 2;
cTopBanner.y = GetViewportY() + (PUT HEIGHT OF BANNER HERE);

Shane 'ProgZmax' Stevens

I believe CJ meant SetViewport there, not SetViewpoint.  Just so you don't get confused.

Miori

Now the bars don't lag anymore, but the player XD

SMF spam blocked by CleanTalk