AGS 4.0 - Alpha 23 for public test

Started by Crimson Wizard, Thu 01/06/2023 14:00:59

Previous topic - Next topic

Baguettator

Quote from: Crimson Wizard on Thu 17/07/2025 17:45:51In the latest AGS 4 you can import only 1 font file and create any number of fonts from it, each with different settings. Is that what you are referring to?

Well I was thinking about :

- importing a font file
- create a button
- give this button the font you just imported
- choose the size of the font for THIS button (and eventually its style if possible)
- allow to manipulate font's property for each button or things using texts (labels etc...), such as the font's size, dynamically in scripts. My best example for it is about translations : if you have a button with the text "ABCD" inside, and when you change translation the texts becomes "ABCDEFGHIJ", the button could be too small to have the text properly inside, so you could just change the font's size to fit the text there.

Crimson Wizard

#381
Quote from: Baguettator on Fri 18/07/2025 22:29:41Well I was thinking about :

- importing a font file
- create a button
- give this button the font you just imported
- choose the size of the font for THIS button (and eventually its style if possible)
- allow to manipulate font's property for each button or things using texts (labels etc...), such as the font's size, dynamically in scripts. My best example for it is about translations : if you have a button with the text "ABCD" inside, and when you change translation the texts becomes "ABCDEFGHIJ", the button could be too small to have the text properly inside, so you could just change the font's size to fit the text there.

Giving each control additional font settings will be suboptimal IMO, not only because that's going to be an extra hassle to configure font on each control, but also because the font renderers must cache the glyphs (letters) in each separate size and style (they don't load font once and then display resized, they actually precreate letters in each size). If there will be a setting for each button, label, etc, that may give users an idea that they may ignore the number of font variants, and they will eventually boost the amount of cached fonts. So I'd rather not do that.

I'd rather keep a single "Font" property on things, and have all settings in a Font object. You can already have any number of Fonts from a single file in AGS 4, where you import a font file once, and create any number of font variants from that font file. We may have a "style" added later as well, if we support attaching multiple style font files as a single "font file source".

This leaves a translation problem, and ability to create Font objects at runtime, either as a command in script, or an instruction in the translation file. That's something that has to be developed from ground up, as right now there's no font structure in script at all, nor a collection of fonts that one could iterate, only numbers. But that should be feasible in theory.

Baguettator

OK I understand ! I thought Fonts were scaled according to their size, the glyphs being vectorized. I was wrong !

So perhaps I can try something in my script as a workaround :

- create an enum with all iteration of one font (so TimeNewRomans 10, TimeNewRomans 15, TimeNewRomans 20 etc... for example), from the smallest to the biggest

- change the translation

- verify each button/label/whatever that has text inside : while text.Width > object's size, object.font-- (using the enum) OR while text.Width < my_minimum_I_defined, object.font++

It could take some time to proceed, but could work I presume.

Another thing I just thought about : possibility for buttons having their text displayed on several lines (same way as labels) ?

Crimson Wizard

Quote from: Baguettator on Sat 19/07/2025 06:34:40Another thing I just thought about : possibility for buttons having their text displayed on several lines (same way as labels) ?

This is already supported in the latest version, you just need to enable WrapText property.

Crimson Wizard

#384
Updated to Alpha 23
(Please use download links in the first post)

This update contains all the additions and fixes from 3.6.2 Patch 2 (except ones related to backwards compatibility).

Own changes:

Editor:
 - Fixed memory leak occuring when compiling room scripts, which may eventually lead to "out of memory" errors.

Compiler:
- Compiler checks arguments of text formatting functions where possible, and reports mismatching args during compilation.
- Fixed a wrong error was reported if a "null" is passed as a `const string` function parameter.

Script API:
 - Added GameInfo struct that contains meta-information about the game, such as developer's name, developer's URL, version, and so forth.
- Added VideoPlayer.FrameWidth and FrameHeight properties.
- Added VideoPlayStyle enum, PlayVideo() now uses VideoPlayStyle as "flags" argument.

Engine:
- Improved video playback's synchronization between video and audio streams.
- Fixed engine was closing the game too early while connected Editor is displaying a script error popup, if there was "Watch Variables" pane active at the same time.

Manual
The manual now contains WIP version of AGS 4 feature documentation. It will be improved and expanded further in the next updates.



EDIT:
The new GameInfo struct was added in script, this lets read the game and developer information that you can optionally enter in General Settings:
Code: ags
builtin struct GameInfo {
  /// Gets the game's title
  static readonly attribute String Title;
  /// Gets the game's description
  static readonly attribute String Description;
  /// Gets the game's developer's name
  static readonly attribute String DeveloperName;
  /// Gets the game's developer's URL string
  static readonly attribute String DeveloperURL;
  /// Gets the game's genre description
  static readonly attribute String Genre;
  /// Gets the game's release date as a DateTime instance
  static readonly attribute DateTime* ReleaseDate;
  /// Gets the game's release version, represented as "X.Y.Z.W" string
  static readonly attribute String Version;
};

Mehrdad

#385
Hi. I'm unable to create an APK for Android. I didn't have this problem in previous versions. Where can I see the log, and what is my mistake?
@eri0o







Edit : No worries, this problem is not relevant to AGS. Our country blocked by google and it's can't download gradle that need for build. I have to search for change DNS or a powerful proxy.

I'll update here if I get success
Sorry again

Edit2: OK. I successfully built an APK for Android with a powerful proxy, and everything works perfectly.
Please ignore this post
 
@eri0o
@Crimson Wizard
My official site: http://www.pershaland.com/

Baguettator

Hi there !

A few things :

- I can't explain why, but in some cases, I encounter a weird thing : when several buttons (2 or three in my case) are one on another, the mouse click doesn't seem to apply to the upper one (the one with the higher ZOrder). I'm using the last AGS 4.0 build, and it was not doing this in 3.6 that I used before. It is something similar that I reported before, with OnCLick functions switching between HotSpots/Buttons with no reason, but this last thing I don't encounter anymore.

- Is it planned to have a natively built-in system of "description" for GUIControls ? Like, the mouse goes over the control, and a text (usually the description of what it's going to do) appear near the mouse. Just like in windows. It could be very practical, and if built-in, it could be without fps loss.

- I tried the "show usage" function by right clicking in a sprite in the sprite tab, I knew it was used for a button in a GUI but it said that it wasn't used by anything. Is there something broken in AGS 4.0 regarding that ?

Crimson Wizard

#387
Quote from: Baguettator on Yesterday at 20:50:17- I can't explain why, but in some cases, I encounter a weird thing : when several buttons (2 or three in my case) are one on another, the mouse click doesn't seem to apply to the upper one (the one with the higher ZOrder). I'm using the last AGS 4.0 build, and it was not doing this in 3.6 that I used before. It is something similar that I reported before, with OnCLick functions switching between HotSpots/Buttons with no reason, but this last thing I don't encounter anymore.

We cannot do much unless there are steps to reproduce. If you could try and narrow down this case to a minimal setup, or figure out under which conditions this happens, then we may diagnose this issue.
If not, then perhaps you could send me your game and tell how do I observe the issue there?

Quote from: Baguettator on Yesterday at 20:50:17- Is it planned to have a natively built-in system of "description" for GUIControls ? Like, the mouse goes over the control, and a text (usually the description of what it's going to do) appear near the mouse. Just like in windows. It could be very practical, and if built-in, it could be without fps loss.

No, this was never asked before, and never planned. This does not seem like a good thing to have built-in either, rather something for a script module.
Why is this an issue to make one in script, and which "fps loss" are you speaking of?

Quote from: Baguettator on Yesterday at 20:50:17- I tried the "show usage" function by right clicking in a sprite in the sprite tab, I knew it was used for a button in a GUI but it said that it wasn't used by anything. Is there something broken in AGS 4.0 regarding that ?

I cannot reproduce this. Tried with default Sierra template, and "show usage" for sprite lists buttons that use that sprite. Please clarify the situation: which buttons is this sprite used on, and which exactly button properties is it assigned to?

Baguettator

OK, I will try some debugging and if I don't find the problem I will send you my game and instructions to find the bug.

"Why is this an issue to make one in script, and which "fps loss" are you speaking of?"
=> It's not an issue, I can make it by script, just I wanted to ask if it was going to be done in AGS :)

"I cannot reproduce this. Tried with default Sierra template, and "show usage" for sprite lists buttons that use that sprite. Please clarify the situation: which buttons is this sprite used on, and which exactly button properties is it assigned to?"
=> It was for a normal graphic of a button. Perhaps I'm pretty sure it happenned ! Will have a look if it happen again :)

New issue I encountered : if I use Display function during a Room Transition, the mouse disappears (is not visible but usable). Room Transition is set to CrossFade wen it happens.

Crimson Wizard

#389
Quote from: Baguettator on Today at 06:29:27"Why is this an issue to make one in script, and which "fps loss" are you speaking of?"
=> It's not an issue, I can make it by script, just I wanted to ask if it was going to be done in AGS :)

Having a gui following cursor, or located e.g. at the bottom of the screen, is trivial, this is same as making one for hotspots.
Having a text selected by gui control under the cursor is also simple. There are 2 fast ways I can think about:
1. Have 2-dimensional array of strings, and use Gui ID + GuiControl's ID as array indexes. This may be done in AGS 3 too (2-d array can be emulated).
2. Use GuiControl's Custom Property to tell its description (custom properties are added to Gui Controls in AGS 4).
Both solutions should be fast  and simple. 2nd solution seems more convenient, especially now when custom properties are displayed right in the list of object's properties.

Quote from: Baguettator on Today at 06:29:27New issue I encountered : if I use Display function during a Room Transition, the mouse disappears (is not visible but usable). Room Transition is set to CrossFade wen it happens.

Do you mean that it disappears for the duration of transition, or also not become visible after transition?
Where exactly "during transition" do you use Display in which script event? Please give exact details when reporting issues.

Baguettator

My apologizes, I didn't know Custom properties were added to GUICOntrols !! That's a great thing :)

About the cursor, it disappears just before transition (in my code) but don't reappear after the transition (even if in my script the cursor is set to visible).

If I don't spam a Display function after transition, the cursor becomes visible. If I put a Display Function, the cursor stays non-visible until I re-set it to visible after. I will test again that thing to give you more informations, but something is wrong here, and it doesn't seem to be my code.

SMF spam blocked by CleanTalk