UIElement Background Image Path

The official Rising World Soundtrack is available!
You can also get the Soundtrack on Steam
  • Loading from plugin resources is broken atm unfortunately :/ But we try to get it fixed with the upcoming hotfix ;) However, loading from a file (e.g. from plugins folder), url, asset bundle or raw byte data should still work.

  • Hehe I'm a hobbiest programmer, so not sure what gradle is ^^


    In the Java version I did this:


    Java
    ImageInformation ii= new ImageInformation(plugin.getPath() + "\\resources\\gui\\tab01.png");

    I've just had a good with this:


    Java
    TextureAsset image = TextureAsset.loadFromFile(plugin.getPath() + "\\res\\test.jpg");
    style.backgroundImage.set(image);

    Now I don't get an error messages, in fact I get a "Loading asset (Texture) from cache: D:\MR2\Plugins\MedievalRealms\res\test.jpg" from the console, so it finds the file.


    However, when I log into my test server the images are missing (transparent bg).


    :wat:

  • Loading from plugin resources is broken atm unfortunately :/ But we try to get it fixed with the upcoming hotfix ;) However, loading from a file (e.g. from plugins folder), url, asset bundle or raw byte data should still work.

    Oooh so ..

    Code
    ta = TextureAsset.loadFromPlugin(plugin, "res/test.jpg");

    Should work in the future? I would very much like to keep all the assets bundled up in the same jar :saint:


    Thanks for the reply Red 8):thumbup: Legend.

  • Your code is correct, and the file can be loaded from a plugin .jar indeed, it's just that the data isn't properly synced with the client apparently (due to a bug). This will be definitely fixed soon ;)

  • Oh, sorry, I misunderstood your previous message :saint: Actually TextureAsset.loadFromFile(plugin.getPath() + "\\res\\test.jpg"); should already work (if there is a "res" folder in your plugin dir) :wat: If the image doesn't show up, there is likely another reason for that (e.g. maybe another style setting causing the image to be transparent or something like that) :thinking: Could you maybe post your style code here (or send it via PM to me)?^^

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!