Hide markers when not in field of view

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Fadden
Posts: 181
Joined: 10 May 2011, 18:21

Hide markers when not in field of view

Post by Fadden »

Hi,

I would display the markers added from script (not the players' labels) only if there are in the field of view. By default the display is :
Image

In this screen the 2 markers "Goal" are above 2 poles. But as I can't see these poles, I would that these markers aren't shown for me.
I haven't found any mathod to do that. Is this possible ?
Elle est où la poulette ?
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Hide markers when not in field of view

Post by steeffeen »

i don't think there is an easy way to do that :/

the only possibility which i can image is doing something like:
- build the markers with manialinks
- check in the script of the manialink if the player is heading in direction of the marker and hide specific markers accordingly
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    Akbalder
    Posts: 1059
    Joined: 15 Jun 2010, 11:00
    Contact:

    Re: Hide markers when not in field of view

    Post by Akbalder »

    I just saw that it's possible to add visibility="WhenVisible" on the markers.
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: Hide markers when not in field of view

    Post by steeffeen »

    Akbalder wrote:I just saw that it's possible to add visibility="WhenVisible" on the markers.
    w00t?! that would be nice :)
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      User avatar
      Eole
      Nadeo
      Nadeo
      Posts: 1265
      Joined: 26 Apr 2011, 21:08

      Re: Hide markers when not in field of view

      Post by Eole »

      There's indeed a "visibility" parameter on the <marker /> tag now. It can take the same values than the player's markers, which are:
      - Never
      - Always
      - WhenInFrustum (the object is in the field of view of the player, even behind a wall)
      - WhenVisible (the object is in the field of view of the player, but not behind a wall)
      - WhenInMiddleOfScreen
      Contribute to the ManiaPlanet documentation on GitHub
      A question about ManiaScript? Ask it here!
      Fadden
      Posts: 181
      Joined: 10 May 2011, 18:21

      Re: Hide markers when not in field of view

      Post by Fadden »

      Very nice thanks ! :thumbsup:

      Akbalder how do you find this before Eole said this ? Random tries ?^^
      I haven't see this parameter in the doc
      Elle est où la poulette ?
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: Hide markers when not in field of view

      Post by steeffeen »

      Eole wrote:There's indeed a "visibility" parameter on the <marker /> tag now. It can take the same values than the player's markers, which are:
      - Never
      - Always
      - WhenInFrustum (the object is in the field of view of the player, even behind a wall)
      - WhenVisible (the object is in the field of view of the player, but not behind a wall)
      - WhenInMiddleOfScreen
      Nice! Thanks :thumbsup:
      Fadden wrote:Very nice thanks ! :thumbsup:

      Akbalder how do you find this before Eole said this ? Random tries ?^^
      I haven't see this parameter in the doc
      Yep, Akbalder: Tell us your secret! :D
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        Akbalder
        Posts: 1059
        Joined: 15 Jun 2010, 11:00
        Contact:

        Re: Hide markers when not in field of view

        Post by Akbalder »

        Fadden wrote:Akbalder how do you find this before Eole said this ? Random tries ?^^
        Read all the the Maniascript files of Nadeo! :roflol:
        (It was in the melee gamemode)
        User avatar
        steeffeen
        Translator
        Translator
        Posts: 2463
        Joined: 14 Oct 2012, 16:22
        Location: Germany

        Re: Hide markers when not in field of view

        Post by steeffeen »

        Akbalder wrote:
        Fadden wrote:Akbalder how do you find this before Eole said this ? Random tries ?^^
        Read all the the Maniascript files of Nadeo! :roflol:
        (It was in the melee gamemode)
        damn it. i only read the new ones :D
          Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

          ManiaControl, FancyManiaLinks
          User avatar
          TGYoshi
          Posts: 795
          Joined: 15 Mar 2011, 16:59

          Re: Hide markers when not in field of view

          Post by TGYoshi »

          Or simply read the maniascript source file.

          Code: Select all

          enum ELabelsVisibility {
           None,
           Never,
           Always,
           WhenInFrustum,
           WhenVisible,
           WhenInMiddleOfScreen,
          };
          =3
          Post Reply

          Return to “ManiaScript”

          Who is online

          Users browsing this forum: No registered users and 1 guest