Image dimension for Android devices

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Image dimension for Android devices

#1 Post by Jibus »

As we all know, Android is on many devices with different screen :

http://developer.android.com/guide/prac ... pport.html

It may be a stupid question, but I couldnt find how to manage the different screen size ?

Shakezula
Regular
Posts: 67
Joined: Wed May 20, 2015 8:01 pm
Contact:

Re: Image dimension for Android devices

#2 Post by Shakezula »

I've been looking up similar things recently. So far I've determined that the ratio of the dimensions is more important that actual resolution.

If I understand your question correctly, you'll find that information here: http://renpy.org/doc/html/config.html

Using the following method, you can set the starting screen resolution, in an init block.

Code: Select all

init python:
    #Use a widescreen resolution.
    config.screen_width = 1024
    config.screen_height = 600
In the screen language and screen actions chapters of the documentation you can find out how to let users change it as needed in an options screen.

If I misunderstood you and you're just trying to research the different screens your project will come across, I guess you can start here: https://en.wikipedia.org/wiki/Comparison_of_smartphones
Last edited by Shakezula on Wed May 27, 2015 12:46 pm, edited 2 times in total.

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: Image dimension for Android devices

#3 Post by Jibus »

Thank you for answer.

I am not sure to follow. I made a VN for ios with another framewok, and i have different asset for each device :

Example for a background

backyard.png <- A 480x320 image, for the old iPhone
backyard-hd.png <- An 1136x640 image, for iPhone 4 and iPhone 5
backyard-ipad.png <- 1024x768 image for iPad 1 & 2, and iPad mini (first-gen)
backyard-ipadhd.png <- 2048x1536 image for iPad 3 and newer, and iPad mini 2 and newer

My question is what approach do we need to have in order to support a large range of android mobile phone ? In Renpy, there is only one size defined. Does the framework resize automatically ?

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Image dimension for Android devices

#4 Post by xela »

Jibus wrote:My question is what approach do we need to have in order to support a large range of android mobile phone ? In Renpy, there is only one size defined. Does the framework resize automatically ?
It does but not it doesn't account for different ratios (you'll have black spacing instead). Rest depends on how you write your code, you can have Ren'Py pick different resources just like in your other engine and/or resize them as you see fit but it's something you code yourself if you find normal resizing that Engine goes insufficient.
Like what we're doing? Support us at:
Image

Shakezula
Regular
Posts: 67
Joined: Wed May 20, 2015 8:01 pm
Contact:

Re: Image dimension for Android devices

#5 Post by Shakezula »

Jibus wrote:Thank you for answer.

I am not sure to follow. I made a VN for ios with another framewok, and i have different asset for each device :

Example for a background

backyard.png <- A 480x320 image, for the old iPhone
backyard-hd.png <- An 1136x640 image, for iPhone 4 and iPhone 5
backyard-ipad.png <- 1024x768 image for iPad 1 & 2, and iPad mini (first-gen)
backyard-ipadhd.png <- 2048x1536 image for iPad 3 and newer, and iPad mini 2 and newer

My question is what approach do we need to have in order to support a large range of android mobile phone ? In Renpy, there is only one size defined. Does the framework resize automatically ?
The image will resize but it won't change the ratio of width/height. Have you ever tried watching a standard definition show or movie on a high definition television or vice versa? Or resized the dimensions of a video player on a computer?
The image will enlarge as needed until either width or height hits the border of the screen, and since the other dimension has not touched yet, you will simply lose the screen real estate and it will default to a long blank black bar.

Check this image out: http://v-play.net/doc/images/squaby-dif ... border.png

What you can do is define different variants of each screen, so that it's only used if it's a particular set of devices that match the aspect ratio.

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: Image dimension for Android devices

#6 Post by Jibus »

So, the easy way would be to have one resolution type like: 1920 x 1080 (my game is only in landscape) and let the device rezize. In some device, we'll have blank space (black) ?

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Image dimension for Android devices

#7 Post by xela »

Yeap, that should work... Ren'Py sizes stuff down/up pretty well. Sadly I never actually tried, usually resources are smaller and get resized "up".
Like what we're doing? Support us at:
Image

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: Image dimension for Android devices

#8 Post by Jibus »

Do we need to use the frame function, or it should do it automatically ?

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Image dimension for Android devices

#9 Post by xela »

It's a container class I think, not a function and doesn't really have anything to do with "different" resolutions. Just use it when it is sensible to use a frame, there is no point of putting everything in Frames, there would not be even if you took a much more complicated approach supporting multiple resolutions.
Like what we're doing? Support us at:
Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]