Quick question.
Monkey Forums/User Modules/Quick question.
| ||
when we load images the default root is the location of the source, we tend to as a result create graphics or sprite folders to keep things neat, and we then load our graphics from these folders. but is it possible for a module to have its own graphics contained within the module, and if so, how would you load them, how would you get the path to the module for the loadimage call. |
| ||
Add a "data" folder to your module, then in the modules source do something likeImport "data/mojo_font.png" that is how mojo does it and I am convienced it would work with our modules too. |
| ||
Just checked, that is how it works. |
| ||
Sweet thanks mike. |
| ||
How do you get at that once its imported tho, just a flat loadimage(mojo_font.png) ? |
| ||
Ignore me just checked mojo source and saw what it was doing , thanks again for pointing me in the right direction. |
| ||
why would you do that? :D |
| ||
why would I want an image in with the module? , mojo's DrawText is a perfect example, if you want a default sprite sheet or sprite to be used with the module for when the programmer does not want to set his new new shiny image. in my case it was going to be a default Virtual D-Pad and buttons, but I couldn't get it to load correctly. so just moved it into the project data folder. :/ oh well, might try again in the morning after I sort out my current admob issue. |