Page 1 of 1

Viewport position

Posted: Wed Jan 26, 2022 4:28 pm
by BrotherKerubim
Hello, guys. Guess I need some little help here.
I'm using several viewports in my screen in order to achieve 3d effect when you edgescroll it.

In my opinion it looks great and I dont want to give it up.
But when player starts some dialog or changes scene, this screen shuts down and I have to show some static image as a scene bg and ofcourse it is not cosidering what "location" player had in that screen.

Here is some little gif showing what I mean:
https://drive.google.com/file/d/1ol1wxH ... sp=sharing

The whole code looks like this:

Code: Select all

screen ship_deck():

    zorder -1
    viewport id "ship_deck_sea_bg4":
        child_size 2021, 1080
        edgescroll (600, 1000, speed_scroll_sea4)
        add "ship_deck_sea_horizon_4" at wave_shaking4     

    viewport id "ship_deck_bg":
        side_xpos 0
        side_ypos 0
        child_size 3658, 1080
        edgescroll (600, 1000)

        add "ship_deck_screen"

        imagebutton:
            idle "ship_deck_hatch"
            hover "ship_deck_hatch hover"
            focus_mask True
            action Call("ship_deck_hatch")   


    viewport id "ship_deck_right_side":
        side_xpos 0
        side_ypos 0
        child_size 3658, 1080

        edgescroll (600, 1000, speed_scroll_right_side)
        add "ship_deck_right_side"
Personally I have only two ideas:
1. Get X coordinates of each displayed image on screen at the moment when you click on any imagebutton, then show some composite image as a background with displacement of each layer of an image for right amount of coordinates.
2. It's folly, but maybe I can make some picture of a screen in exact time when player clicks on imagebutton and this picture will be a background for the following dialogs and dissolves. Then it removes somehow from file storaging when it's no more needed.

There may already be a simple solution that I don't know... I really hope for any good ideas!

Re: Viewport position

Posted: Thu Jan 27, 2022 3:34 pm
by Alex
BrotherKerubim wrote: Wed Jan 26, 2022 4:28 pm ...
1. Get X coordinates of each displayed image on screen at the moment when you click on any imagebutton, then show some composite image as a background with displacement of each layer of an image for right amount of coordinates....
You can store the values of viewports and use them later - viewtopic.php?f=8&t=58441#p526802

Re: Viewport position

Posted: Thu Jan 27, 2022 4:26 pm
by Ocelot
Sadly Issue 2920 prevents more clear and concise approach using 3D stages.

Re: Viewport position

Posted: Fri Jan 28, 2022 2:14 am
by BrotherKerubim
Alex wrote: Thu Jan 27, 2022 3:34 pm
BrotherKerubim wrote: Wed Jan 26, 2022 4:28 pm ...
1. Get X coordinates of each displayed image on screen at the moment when you click on any imagebutton, then show some composite image as a background with displacement of each layer of an image for right amount of coordinates....
You can store the values of viewports and use them later - viewtopic.php?f=8&t=58441#p526802
Oh thanks, that was exactly the solution I needed. You are a lifesaver!