Adam's Lair Forum

game development and casual madness
It is currently 2017/04/25, 12:27

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 2016/09/03, 07:11 
Novice Member
Novice Member
User avatar

Joined: 2016/04/03, 07:48
Posts: 17
Role: Hobbyist
Hello everyone!

I've been away for a bit and am now on my second Duality project, which, unfortunately, had the bright idea of a background that is supposed to fit the screen. I need a way to run this game in full screen without it breaking the layout if the end user resolution doesn't exactly match the user data and camera focus distance. I only use flat cameras.

I know this has been asked before and answered, but I can't find it on here or though the google search of the site.

Somewhere, someone came up with a way to do different full screen resolutions, and I don't have the skill to figure it out on my own (or find it on here, apparently). I think it involved rendering the camera to texture, but no search of "camera, full screen, resolution, render to texture" or combinations of those terms yields any of that in google.

On the subject of sizing things to the window...

I've noticed in windowed mode that the padding on the actual Windows window cuts into the set screen resolution. On my grid image of 16x16 squares with the user data set to the grid image size and in windowed mode, the edge squares are cut off on the left and right, and it looks like a little bit on the top and bottom.

Sorry I suck and am needy, I didn't name myself this lightly, and, as always, I am embarrassed to ask, but glad to be here.

-ST

EDIT :

I apologize, I have since found

viewtopic.php?f=4&t=749
viewtopic.php?f=4&t=683

and the various links out of those. I am a heel for posting another redundant question, I will knock it off now.


Top
 Profile  
 
PostPosted: 2016/09/03, 18:10 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1948
Location: Germany
Role: Professional
StupidThunder wrote:
EDIT :

I apologize, I have since found

viewtopic.php?f=4&t=749
viewtopic.php?f=4&t=683

and the various links out of those.


So.. does that mean your question has been answered by these two threads? Feel free to ask if that doesn't resolve things for you.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2016/09/04, 08:11 
Novice Member
Novice Member
User avatar

Joined: 2016/04/03, 07:48
Posts: 17
Role: Hobbyist
Hello, Adam!

Yes, thank you. I was able to set up two cameras and use one to render the smaller background image onto a larger texture which fit a higher screen resolution. I haven't experimented with scaling that texture during runtime yet, but if it works the way scaling other sprites do, I don't expect too many surprises.

Under "User Data" should I set the Gfx Mode to "Native" and then give the player the ability to set the scale of the render target object to best match their own screen resolution, or should it also involve adjusting the focus distance on the camera? I am using flat cameras for pixel art, and so far just changing the scale seems to work.

I have a joke somewhere about setting the texture scale by the mouse scroll wheel with a tooltip saying "scroll mouse to guess screen resolution."

Thank you again for responding, I appreciate your help. Apologies for posting under the wrong heading.

-ST


Top
 Profile  
 
PostPosted: 2016/09/04, 08:45 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1948
Location: Germany
Role: Professional
StupidThunder wrote:
Under "User Data" should I set the Gfx Mode to "Native" and then give the player the ability to set the scale of the render target object to best match their own screen resolution, or should it also involve adjusting the focus distance on the camera? I am using flat cameras for pixel art, and so far just changing the scale seems to work.

For my game jam entry (WiP) which does a lowres rendering and scales it up to screen, I did this: https://github.com/ilexp/dtj2016-08/blob/master/DungeonCrawler/Source/Code/CorePlugin/ScreenRenderTargetResizer.cs. Not sure if that's applicable to your use case though. What is does is automatically adjust the rendertarget to half the size (rounded up) of the window, because the game is windowed and user-resizeable.

Btw. if you're using this just for the background, you could also implement a custom renderer, which simply renders the background depending on screen resolution.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 8 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:  
Powered by phpBB® Forum Software © phpBB Group