The International Simutrans Forum

 

Author Topic: Lock the screen position  (Read 290 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1109
    • Simutrans-BLOG
  • Languages: ES
Lock the screen position
« on: October 07, 2018, 07:05:54 PM »

I was thinking about a function to keep the screen in a section of the map, with this I can make the player stay in a marked region until he completes the assigned task.

Example: As seen in the image, the player must connect the track of the train to be able to advance to the next step, then at that moment he does not need to move the screen, then this is where blocking the screen makes a lot of sense, thus avoiding that the player gets lost beyond the area marked with (X).

  Is the same principle used when trying to go beyond the edges of the map... is it possible to implement that?.
Edit.
It would also be great to show a dark transparent layer (like the station cover) to visually indicate that the rest of the map is inaccessible temporarily and restrict the use of any tool beyond the limits, you should return a message if you use a tool .
It would be great to have this in the tutorial scenario, it would make things easier for me.
Regards !!.
« Last Edit: October 07, 2018, 07:38:58 PM by Yona-TYT »

Offline ACarlotti

  • *
  • Posts: 237
Re: Lock the screen position
« Reply #1 on: October 07, 2018, 11:07:38 PM »
If this is implemented, then it should be in the form of a bounding box (or polygon of some sort) that the player can scroll to see the entirety of, but not scroll any further. Any system of bounding the centre of the view will probably fail when the window size is smaller than expected.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1109
    • Simutrans-BLOG
  • Languages: ES
Re: Lock the screen position
« Reply #2 on: October 07, 2018, 11:48:07 PM »

@ACarlotti
Do you mean to keep the course in the delimited or fenced region?
In any case, a minimum value can be set for the coordinate delimitations.

Offline ACarlotti

  • *
  • Posts: 237
Re: Lock the screen position
« Reply #3 on: October 08, 2018, 12:03:07 AM »
Do you mean to keep the course in the delimited or fenced region?
I don't know what you mean here.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1109
    • Simutrans-BLOG
  • Languages: ES
Re: Lock the screen position
« Reply #4 on: October 14, 2018, 12:22:10 PM »
If this is implemented, then it should be in the form of a bounding box (or polygon of some sort) that the player can scroll to see the entirety of, but not scroll any further. Any system of bounding the centre of the view will probably fail when the window size is smaller than expected.

Sorry, I was the one who did not understand your message in the first place.

I don't know what you mean here.
I was referring to the course that marks the tiles, that can not leave the delimited region.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2831
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Lock the screen position
« Reply #5 on: October 15, 2018, 12:41:23 AM »
What ACarlotti is saying is that if the API is to set only a center coordinate it will fail if you build the scenario in a 1920x1080 fullscreen but the player is playing in a 800x600 window. You'll see much more area than the user.

So to prevent this happening one would set the area the user can see, with two sets of coordinates to set a rectangle.

Anyway, I don't think there should have an API to prevent the user from going around the map, instead there should have an API that draws a rectagle on the screen to let the user know that the objective will only validate inside that area.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1109
    • Simutrans-BLOG
  • Languages: ES
Re: Lock the screen position
« Reply #6 on: October 15, 2018, 03:01:55 AM »
I would like the rest of the map to be darkened with a dark transparent cover, as seen in the transparent station coverts.  ;)