Adam's Lair Forum

game development and casual madness
It is currently 2018/11/21, 04:44

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2018/09/05, 20:08 
Novice Member
Novice Member
User avatar

Joined: 2018/08/28, 17:12
Posts: 12
Role: Hobbyist
Hi.

Maybe it is right in-front of my eyes but I can't find it.
Is there any way to display the starting location of the camera and size of the screen in the editor?

My problem is that I'm trying to position few things to be right at the bottom of the screen but I need to play some guessing game because I have no idea where is the bottom of the actual game screen. I see there are two cameras to choose from cam view and main camera but I can do the same with both cameras in the editor, I can zoom in out and move around in the editor and get completely lost.

Is there any way to highlight the position and size of the screen for reference so we know where to position and how to scale our objects to fit the actual game screen without need to run the game?

What I'm looking for really is only some colour lines on the grid representing the game screen for reference. Is there anything like this in Dualitor?

Thank you in advance.


Top
 Profile  
 
PostPosted: 2018/09/06, 08:31 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2063
Location: Germany
Role: Professional
Hey there,

the feature you're looking for does not exist yet, unfortunately. In the Game View mode, you can see what's actually rendered, but not edit. The closest thing to what you want is selecting your main camera in the Cam View like you mentioned, which will let you look through the lens of the real game camera that is also used when running the game. While you can still move around, this will actually move the real game camera and change the view you get when starting - so you really see what you get.

The only thing that's missing here is displaying the boundaries of the game screen in default resolution. This needs to account for perspective projection, and also the fact that users will have different screen sizes, or can resize their game window. But for reference, let's assume that the default size from the settings is used.

In order to display those boundaries with a helper object, create a new SpriteRenderer, use its custom material with an Alpha DrawTechnique and a color that's mostly, but not completely transparent. Now adjust its rect to the size of your default game window (say 1920x1280), center it (so it's position would be -990, -640) and parent the object to the main camera object in the scene view. As you move the main camera around, you should now see the helper object move along, covering the region that would be visible in a window of the assumed size. If you now switch to the main camera in the Cam View, you can still see that helper object telling you what's visible and what isn't.

One thing this helper object does not account for is perspective - we just assume all objects are at 1:1 distance (usually 500 Z units away from the camera), which should be true for the most important stuff.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2018/09/06, 15:22 
Novice Member
Novice Member
User avatar

Joined: 2018/08/28, 17:12
Posts: 12
Role: Hobbyist
Thank you for the reply and the work around. I'm going to try that :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group