Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load PNG file into ImageTexture #17650

Closed
sprite-1 opened this issue Mar 20, 2018 · 8 comments
Closed

Can't load PNG file into ImageTexture #17650

sprite-1 opened this issue Mar 20, 2018 · 8 comments
Milestone

Comments

@sprite-1
Copy link

Godot version: 3.0.2

Issue description: The ImageTexture only accepts resource files instead of being able to take in regular images.

Steps to reproduce:

  1. Create a WindowDialog node.
  2. On the property inspector, try to add a Custom Icon for the close button.
  3. Select "New ImageTexture"
  4. Open the blank ImageTexture
  5. Try to load a regular image file (you won't see it because only resources are accepted)
@Zylann
Copy link
Contributor

Zylann commented Mar 20, 2018

Step 3) can be done differently, which would actually solve your problem:
instead of "New ImageTexture", click "Load", and you will be able to use any PNG from your project.
It won't be an ImageTexture though, but a StreamTexture.

Even if it's not usual steps, ImageTexture should accept image formats though.

@sprite-1
Copy link
Author

If I do that the close button icon doesn't change. So I looked at the default theme for Godot 3 and it used ImageTexture so I put two and two together and figured I need ImageTexture too.

@Zylann
Copy link
Contributor

Zylann commented Mar 20, 2018

That's even weirder... why would a StreamTexture make any difference? There are at least 3 issues here:

  • Need to be able to import an image as an ImageTexture, or an Image, instead of a StreamTexture
  • Ability to set a StreamTexture to change the icon
  • Ability to load regular images inside an ImageTexture from the editor

@sprite-1
Copy link
Author

Are you able to reproduce the issue of not being able to change the WindowDialog close button with an image?

@Zylann
Copy link
Contributor

Zylann commented Mar 20, 2018

I can't launch Godot right now but I can try to repro later

On a side note, keep in mind everytime you do "New TextureXXX" or "New Image" in the inspector, you have the risk that the data gets litterally saved into the scene, which means all pixels of the texture being written as numbers, which will make your scene go super fat.

@sprite-1
Copy link
Author

Are there any updates on this?

@ghost ghost added bug topic:core labels Apr 4, 2018
@ghost ghost added this to the 3.1 milestone Apr 4, 2018
@AlexHolly
Copy link
Contributor

AlexHolly commented Jul 22, 2018

#5738
I can confirm that "Load" on "custom_icons -> Close" has no effect and shows always the default icon.

@reduz
Copy link
Member

reduz commented Jul 29, 2018

This is now fixed via 317dee9 , although its kinda useless to do this anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants