Positioning text window GUI[SOLVED]

Started by T800System, Tue 08/01/2013 19:18:19

Previous topic - Next topic

T800System

Hey, I'm having trouble trying to position my text window GUI. It's for a dialog option, which I want to position at the bottom centre of the screen. Obviously to do this I have set "Use GUI for dialog options" to 1 (which corresponds to the GUI number that I want to use) in the general settings.

In my first (and only) room script, I've got the following regarding this dialog option:

    gTestgui.SetPosition(10, 10);
    dBartender.Start();

The setposition code isn't doing anything to move the dialog options to where I want them. They're just staying centred. Could someone tell me what I'm doing wrong please?

Thank you in advance

Slasher

#1
Text Window Gui's are hard coded and are always centered. You need to use a plain Gui and then you can set its position.

You might need to adjust dialog options x and y if required.

Example:
Positions dialog options
Code: AGS

 game.dialog_options_x = 10;
 game.dialog_options_y = 14;

Unlike Text Windows, plain Gui's don't stretch or shrink to accommodate text.

Hope this helps

T800System

Aha! I was just trying this and then you replied confirming it :) And just as I saw it was working; a new question entered my head - and that was how I could specify where the text would sit in the GUI. And you have preemptively answered that with the game dialog options. Brilliant!

Thank you very much, mate!

Khris

If you need to get a bit more sophisticated, you can render the dialog options GUI yourself:
http://www.adventuregamestudio.co.uk/manual/CustomDialogOptions.htm

T800System

Quote from: Khris on Tue 08/01/2013 20:21:39
If you need to get a bit more sophisticated, you can render the dialog options GUI yourself:
http://www.adventuregamestudio.co.uk/manual/CustomDialogOptions.htm

Awesome, thank you.

SMF spam blocked by CleanTalk