0 votes


I have several pixel art images to superpose in a single image (texture / frame).
But it looks blurry even tough the import is set to pixel art.


At the left: the texture "created" and at the right another texture with the same settings as the images took to create the left one.


var frame = new Image();

 for (var x = 0; x < head.GetWidth(); x++)
  for (var y = 0; y < head.GetHeight(); y++)
   var pixel = head.GetPixel(x, y);
   frame.SetPixel(x, y, frame.GetPixel(x, y).Blend(pixel));
 // Same for other parts..

 var texture = new ImageTexture();

 return texture;

Images used:
enter image description here

Thanks guys !

asked Jun 11, 2018 in Engine by Alexande Daubricourt (30 points)

1 Answer

+3 votes
Best answer

I've noticed that your code is in mono, but my reasoning should still apply.
CreateFromImage should have a second argument with a default value of Texture.FLAGS_DEFAULT which means that it will come with mipmaps, repeating, and what you don't want, filter. So setting it to 0 should do the trick.

texture.CreateFromImage(frame, 0)
answered Jun 11, 2018 by SIsilicon (3,796 points)
selected Jun 11, 2018 by Alexande Daubricourt

Right !
enter image description here

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.