Menu

Show posts

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 Menu

Topics - Pax Animo

#1
Hey there, AGS folks

I'm trying to figure out how to control multiple list boxes by turning them on and off via their ID. I've been experimenting with them for a while and looked through the manual, but I must admit I'm still a bit at a loss when it comes to GUI controls in AGS. I'm simply trying to do something as provided below:

Code: ags
function list_box_control(int lstb_id) {
  if (ListBox[lstb_id].visible) ListBox[lstb_id].visible = false;
  else ListBox[lstb_id].visible = true;
}

i've looked at GUIControl.Visible
bool GUIControl.VisibleGets/sets whether the GUI control is visible. This is true by default, but you can set it to false in order to temporarily remove the GUI control from the GUI.

While the control is invisible, it will not be drawn on the screen, and will not register clicks or otherwise respond to any user input.

Applies To

Inherited by the Button, InvWindow, Label, ListBox, Slider and TextBox.

Example:

btnSaveGame.Visible = false;will make the btnSaveGame button invisible.

See also: GUIControl.Enabled

But this only controls it by it's name not it's ID, arrhh it's one of those days.

Cheers in advance.
#2
Heya,

I'm trying to do basic collision detection but the characters colliding are random, how can i check which characters are colliding so i can pass their id into another function. Something like:

Code: ags
if (character[?].IsCollidingWithChar(character[?])) {
    if (character[?].View != 4) {
      character[?].ChangeView(4);
      character[?].FollowCharacter(character[?], FOLLOW_EXACTLY);
    }
    //
    int saved_id = ?;
  }
SMF spam blocked by CleanTalk