May 15, 20187 yr If I wanted to put an asset in the resouce folder what is the proper approach to do so? Do I under onStart() download the asset into the resouce folder if it doesn't exist? Or is there a way to bake the asset into the jar itself? Thanks.
May 15, 20187 yr I would indeed go with a check in your onStart whether the resources already exist in the data folder or not. Do they? Load them locally. Don't they? Grab them from your/a server. Edited May 15, 20187 yr by Eagle Scripts
May 15, 20187 yr With the new API introduced a few client versions back, the proper approach without downloading from the web would be: In the local script project: - Create a 'resources' package/folder in the root (not in a sub-package) - Put resource files in this folder - Get the resources using Script#getScriptResourceAsStream (provide relative path, eg. "resources/image.png") On the SDN: - Put the resources folder at the root level of your script directory > ScriptName --> src ----> scriptname.mainpackage --> resources ----> image.png ----> font.ttf
May 15, 20187 yr - git root folder - scriptname1 - src - resources (for this script) - scriptname2 - src - resources (for this script) - resources (this is for all scripts)
Create an account or sign in to comment