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.

AppGameKit Classic Chat / screen size issue

Author
Message
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 28th Oct 2012 01:32
I was working on my game and I loaded in a large image. After that I ran the game and everything shrunk. The sprites I had set to size 100 height, 100 width(to fit the screen perfectly) now look tiny. I have to set them to 500, 600 to fit the screen. I haven't set the virtual resolution or the aspect ratio or anything dealing the the screen size. Anyone encounter this problem?

Attached are screen shots of how it looks normal & shrunk

[img]null[/img]

Attachments

Login to view attachments
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 28th Oct 2012 01:32
bug image

Attachments

Login to view attachments
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 28th Oct 2012 01:10
You have not posted any code so here's my guess.

1: You are using SetVirtualResolution
2: The system is reading your command of SetSpriteSize( iSpriteIndex, 100, 100 )
3: Then it is putting your image to 100 pixels by 100 pixels rather than 100% by 100%

that's why your image looks like a 100x100 pixel image.

Hope that helps.

gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 28th Oct 2012 01:27
I don't know how much this will help...
first function loads all my images. 2nd i the app begin where I init my variables



erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 28th Oct 2012 01:57 Edited at: 28th Oct 2012 04:06
Assuming the one called background is the image that is the problem

Your current code is:


Try this:



Basically commenting out the area where you are setting it to be 100 pixels by 100 pixels may fix it.

If not then change the area to add back in the agk::SetVirtualResolution but this time use the settings from your core.cpp file where it has the device_width and device_heigth , make those be the height and width instead. Then set the image size to match it should fix it and it will automatically scale if it is ever maximized or on a different resolution screen

like so



You could also get fancy .. (but I have not found it neccesary) and use the getdeviceheight and gedevicewidth ; save those values in variables and set the image size by the variables. When using virtualresolution I have not needed to do this.

gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 28th Oct 2012 01:58
Theres some other weird things that are happen.

when I comment out agk::SetViewOffset ( fX, fY ); there's a green boarder that appears around the images. I also tried changing the virtual resolution to 100,100 and it temporally fixes it.
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 28th Oct 2012 04:06
I have not seen green boarders yet myself .. possibly something to do with anti-aliasing the images and stretching the edges?

I would suggest setting the virtual resolution to match the device resolution in your core.cp and then design everything to match that.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th Oct 2012 05:21
Do you want to use virtual resolution or percentage?

Your posts and code are not clear and the two do not work the same.

If you want to use percentage and have a background image where the width and height are different, I believe that you need to set your aspect ratio to reflect the size of the image you are trying to use.

If you want to use virtual, then you need to set the sprite size equal to your image size for the background image.

And, you do need to update the Core.cpp (Windows) and Core.m (iOS) files to reflect the resolution you are using. They both have constants for device width and height which seem to override what the device might be reporting.

Cheers,
Ancient Lady
AGK Community Tester
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 28th Oct 2012 05:52 Edited at: 28th Oct 2012 06:01
Thanks for the help. What exact line do I need to change in core.cpp? I want to use the percentage system. Should I do this
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th Oct 2012 17:52
In the Core.cpp/m files, look for the two lines something like this:

This is set for a landscape orientation. But, since you are using the percentage display mode, you don't need to worry about those lines.

I don't use the percentage system and have not worked with it. But your code looks like it should work.

Cheers,
Ancient Lady
AGK Community Tester
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 29th Oct 2012 21:58
Thanks lady I think there's something else going on with my code though I just don't know what it is. I took an old game I was working on in march and ran the application and it looks fine but when I opened up the project in VS compiled it and then run it, everything shrinks. Has there be any updates since March dealing with the screen?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Oct 2012 16:54
The only updates are the v1082, labeled as beta but actually more of an alpha release. Not recommended unless you really want to play with incomplete 3D commands.

Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2024-04-28 16:06:00
Your offset time is: 2024-04-28 16:06:00