Jump to content

WidgetSpriteViewport split screen


photo

Recommended Posts

Hi all,

 

I'm trying to split my screen into 2 viewports (same camera) so I have effectively the exact same view in both viewports.  I'm using WidgetSpriteViewport for this - and it's working ok in so far as it renders correctly.  

However, I also wan't to select objects in each viewport.  Unfortunately whenever I click in the viewport the main viewport underneath the two split view receives the click and the test ray gets performed in the wrong viewport.  So, when I click in one of the split viewports its not getting picked up in the right location. 

 

 

Does anyone know a quick and easy way of making this work?  I'm trying to get the mouse click for the WidgetSpriteViewport then converting it to the large, full screen viewport but it seems quick clunky.

 

Any help would be appreciated.

 

Thanks,

Simon

Link to comment

yep - and again, our uniginescript code base is large and complex.  simpliflying to a stand-alone scene will take time.  Time I don't have unfortunately.

Link to comment

ok - I'll use the viewport sample as an example.  In the attached picture, imagine the circled object is selectable (when clicking on it in the scene it highlights).  Now, currently when clicking on the object in the top right it needs to transform the click to the main viewport - which is does not (and it shouldn't).

 

If I use Unigine::getPlayerMouseDirection( v0, v1 ) returns start/end vectors from the top left, relative to the main viewport.  What I need is a routine to get the mouse click/direction relative to the small viewport.

 

Essentially I need Unigine::getPlayerMouseDirection to return me a vector through the middle of the screen (main viewport) whenever I click on the middle of the smaller viewport.

 

So, I'm after a routine something like "getPlayerMouseDirectionFromViewportWidget()" or something along those lines.  Does this make sense?  Is there a better way of getting around this problem?

 

567.png

Link to comment
×
×
  • Create New...