Thanks to everyone involved!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuGUIControl *guicon = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
Label *lab;
if (guicon != null) //Mouse is on the label
{
lab = guicon.AsLabel;
}
if (lab != null)
{
if (lab.OwningGUI==gInfo)
{
Label3.Text="Select";
}
}
Quote from: eri0o on Sun 26/02/2023 10:32:25Are you trying to make a dark game and facing monitor differences?
Quote from: Crimson Wizard on Tue 21/02/2023 20:08:58This was done in the experimental branch, but now added to 3.6.0 in the latest update.
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-3-6-0-release-candidate-rc1/msg636653570/#msg636653570
Quote from: Snarky on Mon 13/02/2023 07:29:17There is another small improvement we can make in case a particular problem arises:
If the character movement is linked to animation (often called "anti-glide"), and the character movement speed (the distance it moves per animation frame) is large, and the animation delay is significant, then the fade-in effect could appear "jerky," with sudden jumps in transparency.
Specifically, this could become noticeable if AnimationDelay > 2, and 100*MovementSpeed/(endX-startX) >= 2 (but especially if it is some higher number like 4 or 5).
Quote from: Snarky on Mon 13/02/2023 06:51:59Note that we don't use player.Moving or any kind of loop: the transparency is directly tied to the character position, so it will automatically update as the character moves. And therefore we don't need any Waits or anything like that: the mapping of the position to transparency ensures that it fades in to reach full opacity only when the character arrives at the target X.
Quote from: Snarky on Mon 13/02/2023 06:18:21"it doesn't work,
Quote from: Snarky on Mon 13/02/2023 05:59:57The only issue I can see with it is that depending on your animation speed
if (player.Moving)
{
Wait(10);
movem--;
}
int tr = movem; // Khris code :-)
if (tr < 0) tr = 0;
gDark.Transparency = tr;
int x1 = 100;
int x2 = 200;
int steps = 100;
int dx = (x2 - x1) / steps;
for (int i = 0; i < steps; i++)
{
if (player.Moving && x1 + i * dx)
{
gDark.Transparency = 100 - i;
}
}
Quote from: Matti on Sun 12/02/2023 12:43:25This depends on how you want it to work exactly. Should the GUI only become more visible while the player walks and should it immediately become invisible again if the player stops?
You could link the transparency directly to room coordinates, like this for example:
Quote from: Khris on Sun 12/02/2023 13:57:42while is used to create a loop (...)
Quote from: Khris on Sun 12/02/2023 13:57:42A use-case for that is a blocking cutscene where the camera pans across a room.
Quote from: Khris on Sun 12/02/2023 13:57:42AGS has the three repeatedly_execute functions
While (player.moving? player.x >Screen.Width / 2?)
{
GUI.transparency--;?
}
Quote from: Khris on Mon 06/02/2023 21:33:34Yeah, my bad; .TopItem is an integer. I fixed the code in my post
Quote from: Snarky on Thu 02/02/2023 10:44:01I would also add:
-each time the player quits/exits to main menu/brings up the main menu
The only little wrinkle is that you should then ensure that when the game is loaded, it doesn't start off with those menus open. You can do this by closing them in on_event(), inside a check if(data==eEventRestoreGame).
bool QuitTheGame = false;
if (QuitTheGame)
{
QuitGame(0);
}
function on_event(EventType event, int data)
{
if (event == eEventRestoreGame)
{
gQuit.Visible = false; //My quit the game GUI
QuitTheGame = false;
}
}
gQuit.Visible = false;
QuitTheGame = true;
SaveGameSlot(1, "AutoSave");
Quote from: Khris on Mon 06/02/2023 10:53:26You can use this
function btnInvDown_OnClick(GUIControl *control, MouseButton button)
{
InventoryItem* ii = invCustom.TopItem;
invCustom.ScrollDown();
if (ii == invCustom.TopItem) aStuck.Play();
else aScroll.Play();
}
Quote from: Matti on Mon 06/02/2023 11:30:36On a side note: As a player I find it convenient if the arrow buttons already indicate that there are no more items in one direction.
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.051 seconds with 19 queries.