I have an app that has around 3000 pictures associated with people's names. This is a custom game for a kid's camp. It runs on a self contained Windows computer with the only user interaction being the game itself.
I want to be able to show their name and photo in my app.
I will not have the pictures ahead of time, more pictures and names will be added all the time, and all I know is what folder they will be in and that the name of the image will match the person's name.
How should I handle this? Trying to load 3000 images "At RunTime" doesn't seem to be a slick way to handle this.
"Load Image From URL" seems to be the way to go but so far I can't get this to work unless I "Load Image From URL" at "On Start Of Layout" .... How about "While Layout is running" ??? Can I do that ??
Seems like I should be able to do this for handling dynamic, update-able content in my games yet I can't see any method to handle this...
I need to be able to load an image into my "game" at anytime I want and show it. Pre-loading at "RunTime" is extremely cumbersome, at best...
It would also gives my users some level of easy customization, like replacing sounds in the old Maelstrom game on Macintosh...
You would have to load then as needed, one at a time, and into the tiled bg object if you wish to have multiple instances with different textures, at runtime.
So in other words you will need to make a list of the urls of the pictures and load them when they are viewed.
Can you please explain "At RunTime"?
I am believing "At RunTime" to be "when the app starts" or "On Start Of Layout".
But then you say I can load images "when they are viewed"... this sounds like a conflict of information.
It sounds like you are saying:
Load the images into Tiled background layers as the app starts.
Display the loaded images when needed.
That doesn't at all support adding more names and images to the game after its already running...
I need to add more images and names to the game after its already running.
The names are easy.
The images -should- be easy too... the names of the images match the names of the kids so I should be able to pull an image using -- KidsName.Array&".png" -- but this is simply not working at all.
I've followed the tutorials and the manual and all the information is so vague that I can't even figure out if this is -supposed- to work or not!
It might be easier to use project files, but you can have them in the directory, and load via ajax.
You wont be able to do at start of layout.
3000 images all at once would choke any computer.
Develop games in your browser. Powerful, performant & highly capable.
I am totally lost and failing then. The manual is really poor when it comes to explaining how to use this.
I don't want to do this "At Start Of Layout"
But trying to do this on-the-fly is not working.
Load VIA Ajax??
Ok now I am incredibly confused... this is not making any sense at all...
what does AJAX have to do with loading images into the Tiled Background????????]
This should not be this hard.
A single functioning example of pulling a local image from a file and displaying it on-the-fly, while the app is running, would end all confusion.
Unfortunately there are no clear examples of this working on the forums or in the tutorials.
Its quite possible that I'm just giving bad links to the images... If I give the link as a full complete link it works:
but a partial link like ".\Test.png" (look in the same folder as .exe to find the image)
or "..\Images\Test.png" (go up one directory and then check directory Images for file Test.png)
In HTML this is easy... I use short links all the time but so far I have not gotten the same trick to work with C2. When a user hits my main folder and runs my Index.HTML I can then point to Images folders and Data folders and setup all kinds of folder structure and browse through it all from the root (can even use ~/ to return to root!)...
Where is C2 running its default starting folder location from? If its not from the same folder as my .EXE then it would explain why I am having so many failures!
I guess I can fix this by requiring the app be run from the C: root and not from the Desktop... its not hard it just means a lot of phone calls from camp counselors asking "what's a c:? And what's a root?"
Thanks for the help I think I am less frustrated and closer to a solution.