This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

how do i get rid of the white box around my characters sprite?

JETPiLOTJETPiLOT Posts: 2Member

if you can help, cheers

Answers

  • MegalomaniakMegalomaniak Posts: 2,580Admin

    A bit more info would be helpful, or a screenshot in this case.

  • JETPiLOTJETPiLOT Posts: 2Member

  • TwistedTwiglegTwistedTwigleg Posts: 2,561Admin
    edited August 2019

    Looking at the image, you probably need to replace the white pixels with transparent pixels.

    If you open up the image in the image manipulation program of your choice (I use Gimp) and use the erase tool to remove the white pixels so they are transparent. How this is done varies depending on your image manipulation program, but most support have transparency support.

    Once all of the white pixels around the character are transparent, you will need to export/save the image in a format that supports transparency. .png files are generally what I use as it supports transparency and is a lossless format.
    Do not save the file as .jpg, as it does not support transparency and will replace the transparent pixels with either white or black.

    Then you should be able to use the exported image in Godot and the character will be shown without the white pixels.


    Another option is using a shader to remove the white pixels around the character. The shader itself is not too hard to write, it just needs to check if the color of the pixel is equal to white, making it transparent if it is.

    However, I would not recommend this solution without the outline around the character to another color, as using white as the transparent color in a shader will also make the white in character's eyes transparent. This method also isn't quite as flexible, as it requires all transparent pixels to be the exact same color.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.