Sign in to follow this  
Wolvorine

perfect image placement on dynamic screens

Recommended Posts

Wolvorine    122
hi, i am working on mobile game development, so if i create any graphical interface for any specific screen then i have to again recreate the things for other resolution of screens for other mobiles. Currently iam working on pixel base work and now images are getting shrink according to the screen's width and height , so having images according to the screen resolution is fine ...but problem is placement of any image on the screen. Suppose if screen resolution is 111x150 and its first image's placement is 10 X axis and 30 Y axis ....what would happend if i get a screen of 333x200 , then what placement of that image could be suitable for that image i knwo i cant use 10X and 30Y vbecause screen is bigger now.... Can any one give me iany dea how to obtain this goal?? thanks in advance Farhan

Share this post


Link to post
Share on other sites
Dancin_Fool    785
Don't use actual screen coordinates. Use offsets based on width and height, so if you want something in the bottom right corner, place it like 10 pixels from width, and 10 pixels from height.

*edit* if you're scaling the images, you probably don't want to actually put 10 and 10, it would be some percentage based on the image.

Share this post


Link to post
Share on other sites
Mekanikles    139
Personally I dislike using percentage/edge-relative coordinates for 2d (I assume 2d as you mentioned pixel work) since I'm used to orthomode in OpenGL. A simple technique would be to use a fixed screen-size internally and then scale it appropriately when you draw.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this