Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / A question about resolutions

Author
Message
Danishly
9
Years of Service
User Offline
Joined: 10th Aug 2015
Location: Norway
Posted: 10th Aug 2015 01:34
Hello guys, I'm super-new to programming, but recently found great interest in it, and i have started on AGK2. There is a LOT to learn for someone who never has touched code before, but the drag'n'drop gamemakers don't really appeal to me. So in advance i thank for every answer to my questions, there will be a lot
Thankfully the AGK2 community is said to be very helpfull and welcoming!

So enough about me, i have a question regarding these commands:
SetScreenResolution
SetWindowSize
SetDisplayAspect
SetVirtualResolution

I see many of the examples here uses the SetVirtualResolution, and thereby uses the pixel-system for placements. But i would like to use the percentage-system. So would that limit my options to SetDisplayAspect and SetScreenresolution?
My apps will be for mostly handheld devices.

I hope you understand my question

Just started - Much to learn
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Aug 2015 10:41
Welocome

Quote: "So would that limit my options to SetDisplayAspect and SetScreenresolution?"


I use virtual resolution, so there are people here who can give you much more help regarding the percentage system. But with regard to these commands, I don't think SetScreenResolution is used very much. It adds limitations, and when you start writing multiple games it may become a problem when reusing code.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Eqqman
9
Years of Service
User Offline
Joined: 15th Jul 2015
Location:
Posted: 10th Aug 2015 23:02
Something to consider with percentages is that although you are guaranteed to get a full-screen view, this means that your images won't look the same from device to device when the aspect ratios differ.

I've been experimenting with this myself and worked out a solution: I decide what the dimensions for a graphic are for the best viewing, and then figure out how to translate this into a percentage for the current device. The 'pro' is that the graphics look the same no matter what the actual screen size is, however, the drawback is that if a graphic always needs to be visible on the screen (such as a UI button), there can't be so many of them next to each other that they don't fit if the screen is too small (a problem that can often be fixed by supporting scrolling menus).

Goo Goo G'Joob!
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 11th Aug 2015 00:19
What I do is use the percentage system. I set the display aspect to -1 and when sizing sprites I set one of the axis to -1 as well. From my experience and the various devices I've tried it looks perfect and full screen on each one.


The only issue I encountered was some sprites weren't in their correct places which I fixed by just pulling the y position from the ground and using that as a basis
Danishly
9
Years of Service
User Offline
Joined: 10th Aug 2015
Location: Norway
Posted: 12th Aug 2015 14:53
Thank you so much for input and answers. I think i would like to experiment more with the pixel-based system.

One more question, how do you guys place your sprites and stuff? Do you look at a sprite and think "oh, this looks like it should be at 453X and 690Y"? Or do you use the placement editor that came with AppGameKit?

Thank you!

Just started - Much to learn
Danishly
9
Years of Service
User Offline
Joined: 10th Aug 2015
Location: Norway
Posted: 21st Aug 2015 00:09
Anyone want to answer that last question?

Just started - Much to learn
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 21st Aug 2015 10:46
For me it depends on the game. For my breakout game I used a simple loop to place the blocks, for my Sokoban I wrote my own simple editor. I also have an editor somewhere that's for platformers so it places tiles somewhat automatically in a way suitable for platforms.

Login to post a reply

Server time is: 2024-11-21 21:05:06
Your offset time is: 2024-11-21 21:05:06