You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
Transparency is provided in AGS primarily in the form of a .Transparency property on a number of elements. This property is in the range of [0, 100]. Internally this is converted to an alpha value of [0, 255] (in the reverse direction). This means that there is a loss of precision going in either direction.
#2525 proposes to add the ability to set alpha values for "RawDrawing" operations. That is a more complicated task, but it will also create inconsistency between this API and the existing .Transparency properties.
Suggested change
Add an .Alpha property to any entity that currently has .Transparency. This will allow users to set transparency using the [0, 255] alpha range. .Transparency can then be deprecated (either by removing it unless backwards script compatibility is set, or just marking it as out of date in the manual).
Open question
There are some functions that take a [0, 100] transparency parameter, namely DrawingSurface.DrawImage and DrawingSurface.DrawSurface (are there others?). Ideally these should be updated to use alpha, but this is hard to do in a way that doesn't introduce bugs in existing scripts. Note that this problem also applies to #2525.
The text was updated successfully, but these errors were encountered:
There are some functions that take a [0, 100] transparency parameter, namely DrawingSurface.DrawImage and DrawingSurface.DrawSurface (are there others?). Ideally these should be updated to use alpha, but this is hard to do in a way that doesn't introduce bugs in existing scripts.
In the past similar change was done couple of times by placing old variants of functions or properties under the script API switch.
Problem
Transparency is provided in AGS primarily in the form of a
.Transparency
property on a number of elements. This property is in the range of [0, 100]. Internally this is converted to an alpha value of [0, 255] (in the reverse direction). This means that there is a loss of precision going in either direction.#2525 proposes to add the ability to set alpha values for "RawDrawing" operations. That is a more complicated task, but it will also create inconsistency between this API and the existing
.Transparency
properties.Suggested change
Add an
.Alpha
property to any entity that currently has.Transparency
. This will allow users to set transparency using the [0, 255] alpha range..Transparency
can then be deprecated (either by removing it unless backwards script compatibility is set, or just marking it as out of date in the manual).Open question
There are some functions that take a [0, 100] transparency parameter, namely
DrawingSurface.DrawImage
andDrawingSurface.DrawSurface
(are there others?). Ideally these should be updated to use alpha, but this is hard to do in a way that doesn't introduce bugs in existing scripts. Note that this problem also applies to #2525.The text was updated successfully, but these errors were encountered: