• Version
  • 13 Download
  • 44.60 MB File Size
  • March 6, 2021 Create Date

Equal to AppGameKit Classic Version 2021.02.10
ADD - Agk.Assign(String zipfile) and Agk.Assign(String zipfile, String password) assign a zip file to the search paths for media. you can load media directly out of a zip file.
ADD - Agk.Unassign(String zipfile) remove a zip file from the search path list.
ADD - Agk.ClearAssign() to clear the assign list.

 

Additional functions for media encryption.

int AssignZip(string zipfilename);
Adds a zip archive to the search path for files. For example, if the file 'my.zip' is added with AssignZip("my.zip").
Then all commands that load assets first search for the assets in the directories provided by AGK. If nothing is
found there, the corresponding asset is searched for in the zip file. That is, if LoadImage(1, "my_image.png") does
not find anything in the usual directories. The Zip file is searched for 'my_image.png".

There can also be a directory structure in the zip file.So that files are also loaded in this way
LoadImage(1, "images/my_image.png").

zipfilename -> The path to the zip file to assign.

 

int AssignZip(string zipfilename, string password);
Adds a zip archive to the search path for files. For example, if the file 'my.zip' is added with AssignZip("my.zip").
Then all commands that load assets first search for the assets in the directories provided by AGK. If nothing is
found there, the corresponding asset is searched for in the zip file. That is, if LoadImage(1, "my_image.png") does
not find anything in the usual directories. The Zip file is searched for 'my_image.png".

There can also be a directory structure in the zip file.So that files are also loaded in this way
LoadImage(1, "images/my_image.png").

If you have encrypted your archive with a password, it is necessary to pass your password in the password parameter.It is
not recommended to pass the password directly as a parameter.Instead, it is good to store the password in a secure string and pass
it later.It is even better if the password string is composed of several chars or maybe you use an algorithm.

zipfilename -> The path to the zip file to assign.
password -> The password that was used to create the zip file.

 

void UnassignZip(string zipfilename);
This function removes an entry from the assignment list.The name must be the same as
the name used to assign it to the list.

zipfilename -- The name of the zip file to be removed from the list.

 

void ClearAssignList();
This resets the entire assignment list. All entries in the list are deleted.

Recommended workflow:
All media files you use should be located in the media folder during the development of the app.
When the app is finally published, the entire contents of the media folder can be zipped.
The directory structure created during development should be retained in the zip file.
But be careful when using the SetCurrentFolder/SetFolder command. It does not work inside a zip-file.
And you cannot write to the zip file.
Finally, this zip-file must be included with one of the Assign commands. Further changes to the code should not be necessary.

Hint:
Several zip files can also be assigned. These are then searched one after the other for the files to be loaded.

Leave a Reply

Your email address will not be published. Required fields are marked *