is there anyway to access the in game icons via API ?
in game assets
-
- English
- james1bow
- Thread is marked as Resolved.
-
-
Yes, that's possible with the GameImageInformation object (which is derived from ImageInformation). It can be used to reference game textures or icons. Using it is a bit tricky though, because you need to provide the "path" to the game image. By default it tries to look for a "texture" in the "textures.jar" (which is located in "Rising World/data/assets/"), but if you add "Interface/" at the beginning of the path, it looks for the image in the "interface.jar".
For example, to use the pickaxe icon (which is located in the "interface.jar" under "Interface/Icons/Items/", the file name is "pickaxe_0.png"), the code could look like this:
-
Yes, that's possible with the GameImageInformation object (which is derived from ImageInformation). It can be used to reference game textures or icons. Using it is a bit tricky though, because you need to provide the "path" to the game image. By default it tries to look for a "texture" in the "textures.jar" (which is located in "Rising World/data/assets/"), but if you add "Interface/" at the beginning of the path, it looks for the image in the "interface.jar".
For example, to use the pickaxe icon (which is located in the "interface.jar" under "Interface/Icons/Items/", the file name is "pickaxe_0.png"), the code could look like this:
thanks for the info, i had noticed the gameimageinformation method, glad to know it works in the icons. one thing i noticed while peaking around the .jars is there is no icons for block's. im guessing these icons are created during runtime using model/ texture? i think i can get around this by layering 2 images. one in the foreground with a blank outline of the blocks and lay said texture underneath. thanks again for all the info the last few month's. its been a big part of this learning experience!
-
one thing i noticed while peaking around the .jars is there is no icons for block's. im guessing these icons are created during runtime using model/ texture?
Sorry for the late response, but yeah, the icons for blocks, objects (like furniture) and certain items (e.g. ores) are rendered during runtime, so there is unfortunately no way to access them this way
-
Can in-game models for items like pickaxes be accessed in a similar way, so we can use existing item models for custom items without needing to have new model files on the client end? Something like; ModelInformation modelInfo = new ModelInformation( {some path to in-game item model} ).
I tried something analogous to your GameImageInformation example; i.e. new ModelInformation("Models/Items/Pickaxe/pickaxe_modern.j3o") but that didn't work server side. -
Can in-game models for items like pickaxes be accessed in a similar way, so we can use existing item models for custom items without needing to have new model files on the client end? Something like; ModelInformation modelInfo = new ModelInformation( {some path to in-game item model} ).
I tried something analogous to your GameImageInformation example; i.e. new ModelInformation("Models/Items/Pickaxe/pickaxe_modern.j3o") but that didn't work server side.i had tried something like this and couldnt get it to work. the only supported model information is .blend and .obj. maybe try importing the model.j3o into the jmonkey sdk and convert in to an obj? not sure if that would help as ive not looked into the jmonkey sdk. my work around was to create a gui to craft a new item and assign in an attribute, then using the playerchangeequiped item eventmethod to check for the attribute and make the changes.
-
There is unfortunately no way to access the built-in models through the API This is planned for the new version though.
However, the ModelInformation class should support .j3o files, so basically you could extract them from the game files and ship them with your plugin (in terms of copyright, that's totally fine if you're just using them for RW plugins^^). But I haven't tested .j3o loading in a long time, so unfortunately I'm not sure if it still works properly
-
-
EDIT: So the j3o model loaded just fine, though at size 0.5f it was way too big on screen. lol Adjusting the value helped reign in the model. Not sure how to get it to be one-handed but I'll figure it out.
Hehe, I'm glad to hear it worked About the size, yeah, many models have an individual size factor that gets applied to the model once it's loaded Usually the size factors can be found in the definitions.db file (which can be opened with an SQL editor and is located inside the commons.jar in the data folder).
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!