Is there a way to load image file from disk to WSprite?
See original GitHub issueObviously its no problem if its images already in my assets folder, or some item in the game that already has an Identifier that I’m trying to use with new WSprite(new Identifier("some identifier"))
, but I cant figure out how to (if its even possible) make an arbitrary path to an image C:\Users\user\AppData\Roaming\.minecraft\... .png
usable as a WSprite.
Is there a way to convert some path of an image into an ‘Identifier’, or am I just to use the in-game item Identifiers or preloaded images etc in my assets? If its just the assets folder stuff, is it a thing to load external images into a mods assets folder or something?
new to this stuff btw
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Generating sprites dynamically from PNG or JPEG files in C# ...
// This script loads a PNG or JPEG image from disk and returns it as a Sprite. // Drop it on any GameObject/Camera...
Read more >Load Image at Runtime in Unity - Gyanendu Shekhar's Blog
Load method to load image from resources folder. First, copy your image in the Resources folder. You can find the image used in...
Read more >How to load external images as sprites? - Game Dev Help
Yes, I'm using C2 and working on a server. My pictures are located relatively to the project folder. My point is about an...
Read more >c# - Import Sprite from a file on the Computer and reference it ...
There's 3 parts needed here: Loading a file from disk; Loading the data read from the disk into a Texture2D; Creating a Sprite...
Read more >Displaying a sprite (SFML / Learn / 1.6 Tutorials)
Usually, sprites are loaded from files on hard drive. To load an image from a file with SFML you have to use the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any texture used in LibGui, or any other GUI system, needs to be inside of a loaded resource pack. This can be the vanilla resource pack, a mod resource pack, or a player-added resource pack. For security reasons, it can’t just find any random file on your computer.
@Username404-59 It’d still not be doable. The resource pack system is very strict. There are a few hacky things you could do but LibGui WSprites aren’t built for them. You’d need to likely make your own widget.