Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I have problem with 2d overlays as images. I have a mesh for 2d game but its not fit in Every res. My monitor its widescreen with res 1360 x 768. Same problem with 2d overlays. There is any code or trick to fit 2d overlays or mesh images as overlays in aspect ratio according to screen? To change it dynamic with absolute position? |
||||
|
I always prefer to use absolute positions as well, I don't really like the relative positions in CC, as they are based on the editor and not on the actual app. So it won't actually update the overlays based on your current setup, that's a mess. A good advice is to change the viewport of your editor to your screen size and then use the relative percentage based overlays, that way your app will always gonna reflect the actual relativeness of the overlays with screen. I remember I created an extension for that but never posted it because it was so simple I thought that it wouldn't be necessarily usable for anybody at all. All it does is change the attribute of the overlay from absolute to relative after the game is published and not in the editor that way you can always have the best-aligned and arranged overlays. I just noticed it was lying in the drafts on my itch.io, just made it public in case anybody wants to use it. https://vazahat.itch.io/relative... but this might not be something that you are looking for, anyways you can also grab the screen width and height and can scale the overlays and update their position based on the percentage with the help of javascript, if you want. |
||||
|
Thank you for the full explanation now i understand perfect, if you create for me one ccb file demo file thats be great also if you send me the code thqts great too because i make a lot of tests of it. I have a tons of sample files and tutorials from you but no any sample how the things is works about 2d overlays or mesh image as overlays for 2d games. If you send me something the case its closed. |
||||
|
Also another one issue. When i put a 2d overlay in top or bottom or left of the screen working perfect. If i put it on the right side of screen and after play the game with different resolutions the 2d overlay stretched and ignoring the aspect ratio at least in the right side of the screen. Also i make some extensive tests about screen resolution, the game its in 800 x 600 its wide and stretched except if i choose 16:9 resolutions instead of auto resolution. Auto res i think its 4:3 if yes my game became sipe wide and stretched all its fat. What i must to do? |
||||
|
You can try checking out the visual novel example, it uses 2D overlays but doesn't use the extension that I shared with you. When I will get time I will definitely create a sample for this or a video on this particular topic regarding 2D overlays. There are quite a few things with 2D overlays that I think the community needs to know. |
||||
|
Good thank you i will await one visual sample. Where i found the "visual novel" you are mentioned? |
|