Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | kakidon |
Hello,
I have just migrated from libgdx and trying to learn godot. One thing which I am not able to do or did not find any resources online is how to use different assets source. For eg, in libgdx i had three different file of same texture but with different size. That way i would not need to scale up or down (results in smooth graphics overall) and just render it to viewport. I first queried screen size,and point the asset loader to the specific location while loading, some thing like this
ResolutionFileResolver.Resolution resolutions = {
new ResolutionFileResolver.Resolution(720, 1280, “1280X720”),
new ResolutionFileResolver.Resolution(1080, 1920, “1920X1080”),
new ResolutionFileResolver.Resolution(1440,2560, “2560X1440”)
};
ResolutionFileResolver resolver = new ResolutionFileResolver(new InternalFileHandleResolver(),resolutions);
assetManager = new AssetManager();
assetManager.setLoader(TextureAtlas.class,new TextureAtlasLoader(resolver));
Is it possible to simulate it in godot? Basically I want the sprite to pick up texture source based on the screen size.
In Godot use mip maps for the same effect, but only when using the Display->Window->Stretch->Mode = 2D option under Project Settings.
Godot’s 2D stretch mode is what you are use to from libgdx
When clicking on a image, go to it’s import settings and accept the Mipmap flag, then re-import.
Mip maps are made by the computer from your largest image, it calculates all the smaller versions for you and you don’t have to make them yourself.
Godot also has a Viewport mode, this will scale the image for you at realtime. You won’t need smaller version of the image to do this.
MysteryGM | 2018-09-26 01:07