Personalizing dialogs and giving them a custom design. (SOLVED)

Started by PERXEO, Sun 23/04/2023 21:55:44

Previous topic - Next topic

PERXEO

I have some questions about customizing the dialogs.
1) It is possible to use a GUI as a place to show the texts of the dialogs and I understand that this GUI has to have a text-label to be able to show the options of the dialogs there, but where does AGS tell that this is the field-text where to put the dialogues?
2) How do you change the typography of that text field?
3) What configuration is needed in the GLOBAL SETTINGS for our custom GUI to be used?

Khris

You create a new TextWindow GUI and assign border sprites. Afaik dialogs use Game.NormalFont.
Then you enter the ID of the text window GUI in General Settings -> Dialogs -> Use GUI for Dialog options

For more advanced customization, see here: https://adventuregamestudio.github.io/ags-manual/CustomDialogOptions.html#custom-dialog-options-rendering

(Also, no offense, but all of this is explained in the manual. You should really read it from top to bottom at least once. ;))

PERXEO

I am very grateful to you, and yes, it is true that practically everything is in the manual, but even reading the manual sometimes, not everything is 100% clear to me and it is difficult to find suitable examples out there.

Crimson Wizard

#3
The big issue with the manual right now is that it has dedicated pages for editors and script commands, but does not have these for the basic features. You often have to go through all the "tutorials" or scripting section in order to find out that AGS can do something.

For the same reason, whenever I'd like to refer to how particular feature works in AGS (like speech, animation, dialog options), I cannot simply give a link to an article, and have to explain everything over again.

I opened a task ticket about it once: https://github.com/adventuregamestudio/ags-manual/issues/209

PERXEO

Hi! I've understand all the process explained here https://adventuregamestudio.github.io/ags-manual/CustomDialogOptions.html#custom-dialog-options-rendering but I'm trying to add a background image but it doesn't work:

Code: ags
function dialog_options_render(DialogOptionsRenderingInfo *info)
{
 // info.Surface.Clear(GamePerxeo.color_fondo_dialogos);
  //info.Surface.Clear(COLOR_TRANSPARENT);
  DrawingSurface *surface = info.Surface;

  surface.DrawImage(info.X, info.Y, 1097, 10);
  int ypos = 0;
  // Render all the options that are enabled
  for (int i = 1; i <= info.DialogToRender.OptionCount; i++)
  {
    if (info.DialogToRender.GetOptionState(i) == eOptionOn)
    {
      if (info.ActiveOptionID == i)
        surface.DrawingColor = GamePerxeo.color_opciondialogo_activa;
      else
        surface.DrawingColor = GamePerxeo.color_opciondialogo_noactiva;

      surface.DrawStringWrapped(5, ypos, info.Width - 10,
              eFontPerxeoFont, eAlignLeft, info.DialogToRender.GetOptionText(i));
      ypos += GetTextHeight(info.DialogToRender.GetOptionText(i), eFontPerxeoFont, info.Width - 10);
    }
  }
}

The image I want to add is supposed to have the ID 1097 but with the above code, the background image does not appear. what am i doing wrong?

Crimson Wizard

Code: ags
surface.DrawImage(info.X, info.Y, 1097, 10);

This is wrong; info.X and Y tell the coordinates of a surface on screen, but since you are drawing on surface itself, you should be using relative coordinates, just like you do with DrawStringWrapped (you don't draw string at info.X + 5, but simply at 5).

Code: ags
surface.DrawImage(0, 0, 1097, 10);


SMF spam blocked by CleanTalk