Posted: 24th Feb 2021 20:09
@Polaraul: When I said that I didn't think it would take them two weeks to make a command available for plugins. I even submitted the fix on github a week ago, but no change. That said, I'll use my fix in AppGameKit for Python so I can get it released ASAP.

I'm glad to hear that games are being made with the project. Thanks for choosing it.

As for your question: Yes, using zipfile.read into a memblock and then calling the create_image_from_png_memblock method (once I post the update) on that memblock should work. I have not tried it yet though.
Posted: 25th Feb 2021 12:26
@Adambiser It is now at the point where I suspect TGC will not bother to address the missing commands until the next update, so probably another three or four months! Thank you though Adam for working on the required fix and your continued commitment to AppGameKit for Python. IMHO, it is leaps and bounds above Tier1 AGK. I will have a go at creating an image from a zip file memblock and use create_image_from_memblock (once the create_image_from_png_memblock is available, I will switch out the methods)

Once again, thank you for your help Adam.
Posted: 25th Feb 2021 16:01
@Polaraul: I think you're right about the time frame. The problem I was waiting on was that SetImageSubImages was missing from plugin-related code. While adding this, I discovered bugs in AppGameKit for Python related to using some functions via plugin. I have an idea on how to fix them, but I might release this update before implementing the fix because it could take awhile.
Posted: 25th Feb 2021 18:56
Many thanks for all your help Adam, I look forward to the next release
Posted: 6th Mar 2021 16:05
I'm glad to hear that games are being made with the project. Thanks for choosing it.


I have a small proof of concept project called Books of Splendid Magic created with AppGameKit for Python. Initially it started out as a way to learn Python, but I will probably expand it into a full game.
Posted: 6th Mar 2021 20:39
@Polaraul: Sounds great.
I'm testing the next update. I had to make some rather large changes so that the plugin calls go through the same code that the Python module uses, otherwise, the read file calls (LoadImage, etc) don't work in plugins. Once everything checks out, which it's looking good so far, I'll release the update.
Posted: 7th Mar 2021 13:41
@adambiser Thank you for all the work you are putting into AppGameKit for Python, it is much appreciated. The additional memblock commands of version 2021.02.09 will prove very useful in future asset encryption.
Posted: 10th Mar 2021 3:10
Version 2021.02.10 is up at itch.io!

Devlog

How to load from a zip:
+ Code Snippet
    with zipfile.ZipFile(os.path.join(appgamekit.get_folder(), "storage.zip")) as zf:
        data = zf.read("rgbw.png")
        memblock = appgamekit.create_memblock(len(data))
        for offset in range(len(data)):
            appgamekit.set_memblock_byte(memblock, offset, data[offset])
        appgamekit.delete_memblock(memblock)


I will likely add a create_memblock_from_bytes function in the future so that it can be done like this:
+ Code Snippet
    with zipfile.ZipFile(os.path.join(appgamekit.get_folder(), "storage.zip")) as zf:
        memblock = appgamekit.create_memblock_from_bytes(zf.read("rgbw.png"))
Posted: 11th Mar 2021 14:36
Edited *** Double Post due to forum error ***
Posted: 11th Mar 2021 14:36
@adambiser

Many thanks for all your work on the latest release Adam, it is much appreciated. I like the idea of expanding AppGameKit for Python with library functions not present in Tier 1 AppGameKit, the create_memblock_from_bytes function would be a valuable addition. Using the latest release I am actually able to get asset protection up and running, something that has been asked for in Tier 1 time and time again.

+ Code Snippet
       import appgamekit as agk
       from zipfile import ZipFile
       import os

        with ZipFile(os.path.join(agk.get_folder(), "storage.zip")) as zf:
            blob_data = zf.read("test.png", pwd=bytes('test', 'utf-8'))
            memblock = agk.create_memblock(len(blob_data))
            for offset in range(len(blob_data)):
                agk.set_memblock_byte(memblock, offset, blob_data[offset])

        agk.create_sprite(agk.create_image_from_png_memblock(memblock))
        del blob_data
        agk.delete_memblock(memblock)


I used WinRar to create the password protected zip, but one thing to keep in mind when creating the password, is that Legacy Zip must be checked.
Posted: 11th Mar 2021 16:22
@Polaraul: You're welcome. The memblock also needs to be deleted. I omitted that step in my example code, too.

The board seems to be back to not emailing me topic notifications again.
Posted: 11th Mar 2021 17:06
Oops, I had forgotten that step too!

I have posted a link to Books of Splendid Magic over in the Work in Progress section.
Posted: 15th Mar 2021 22:40
Version 2021.02.10 rev 1 is up at itch.io!

Devlog

Added new commands to make it easier to use bytes objects to load and work with data.

Changes:
* Added: create_memblock_from_bytes
* Added: create_memblock_id_from_bytes
* Added: set_memblock_bytes
* Added: get_memblock_bytes
* Added: get_image_rgba_bytes
* Added: create_image_from_rgba_bytes
* Added: create_image_id_from_rgba_bytes
* Added: create_image_from_png_bytes
* Added: create_sound_from_raw_bytes
* Added: create_sound_id_from_raw_bytes
* Added: create_sound_from_ogg_bytes
* Added: create_sound_id_from_ogg_bytes
* Added: create_music_from_ogg_bytes
* Added: create_music_id_from_ogg_bytes
* Added: add_object_mesh_from_bytes
* Added: create_object_from_mesh_bytes
* Added: create_object_id_from_mesh_bytes
* Added: set_object_mesh_from_bytes
* Changed: get_image_width now returns int instead of float
* Changed: get_image_height now returns int instead of float
Posted: 16th Mar 2021 12:11
@adambiser

Many, many thanks for the new commands Adam, these at last allow AppGameKit to have some kind of asset protection using password protected zips. Hopefully I am using these correctly and have posted a couple of examples below:

create_memblock_from_bytes
+ Code Snippet
        
         with ZipFile(os.path.join(agk.get_folder(), "storage.zip")) as zf:
            memblock = agk.create_memblock_from_bytes(zf.read("test.png", pwd=bytes('test', 'utf-8')))

        agk.create_sprite(agk.create_image_from_png_memblock(memblock))
        agk.delete_memblock(memblock)


create_image_from_png_bytes
+ Code Snippet
        with ZipFile(os.path.join(agk.get_folder(), "storage.zip")) as zf:
            blob_data = zf.read("test.png", pwd=bytes('test', 'utf-8'))

        agk.create_sprite(agk.create_image_from_png_bytes(blob_data))
        del blob_data
Posted: 21st Jun 2021 7:20
Version 2021.06.14 is up at itch.io!

Devlog

?In addition to the updates in AppGameKit Classic:?
* Fixed: Linux extension is now compiled for the stable ABI and should work on all Python 3 versions. ?Tested with Python 3.6 on Ubuntu 18.04 and Python 3.8 on Ubuntu 20.04.
* Changed: InAppPurchaseAddProductID's "consumable" parameter has been changed from a bool to an int and is now called ?"product_type", but this method doesn't do anything on Windows or Linux anyway.

Note that the name of the .so file used by Linux has changed and the old file (appgamekit/_x64/appgamekit.so)?? ?will need to be removed manually?.
Posted: 21st Jul 2022 1:49
Version 2022.06.27 is up at itch.io!

Devlog

Includes the new commands from these AppGameKit Classic updates:
* 2021.10.11
* 2021.10.19
* 2021.12.06
* 2022.04.01
* 2022.06.27

I've also added an example PyInstaller spec file to help with creating Windows EXE distributions for your games.
Posted: 31st Jul 2022 6:12
A lot of python dev has been moving towards Go lately, any chance we might see AgkGo at some point?
Posted: 31st Jul 2022 22:56
I have no experience with Go. Looks quite a bit different from Python, but as long as C static libraries can be integrated with it, it would be doable from a technical standpoint.
Posted: 27th Oct 2022 5:19
Version 2022.09.28 is up at itch.io!

Includes fixes and commands from AppGameKit Classic 2022.09.28.