Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [STICKY] AgkSharp for Windows - General Questions And Feedback

Author
Message
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 13th Jan 2019 07:48
Ok. New Version released.
Download from my site.

-FIX Memory leak when receiving strings from AppGameKit (reported by Chmava)

Maybe it's the memory leak that makes the application hang at the end.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 13th Jan 2019 08:45 Edited at: 13th Jan 2019 09:04


Will you post here to tell me if you have released the fix for the WriteString and writestring2?
Appreciate it!

EDIT: NVM, was on page 6...
EDIT: Just tested it, it seems fine now, ram never goes pass 420mb even after 30 minutes. Keep up the good work! Now, if only it work for max, android, ios?
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 13th Jan 2019 10:30 Edited at: 13th Jan 2019 10:44
Here is another interesting problem...

If you have a directory string variable that end with /.
And if you use Agk.MakeFolder("C:/Something/");

The folder will be made, by an error happen.

Error:" App Terminated!

Invalid path "C:/Something//", folder names must have at least one character.

Is the c# 64bit version missing a "Did string end with a '/' so lets not add an extra one to the end?" check?

In the end, the app run fine and continue as per normal.
This did not happen in the 32bit template and only in the 64 bit version.

On that note, could you have a template that allow both 32 and 64 bit to build without having to copy, paste, reconfigure each other?
Once again, clicking the X does not seem to terminate some kind of service that prevent the .exe from being deleted or pasted over.
Attached is the picture.
I'm quite new, how do you get the .exe to not use AGKSharp_template to appear in task manager?

Attachments

Login to view attachments
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 13th Jan 2019 15:53
You can set the name in the project properties
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 14th Jan 2019 04:37
I did, in task manager, it still appear as AgkSharp_Template
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Jan 2019 06:24
The C# wrapper uses the same sources for 32bit and 64bit. I can't say why the behavior is different there. I do not change the string and pass it unchanged to AGK.

I looked at the C code of MakeFolder. The way I see it it doesn't check if there is a slash at the end of the string or not. In any case one will be added. Therefore it should come in the 32 bit as well as in the 64 bit version to this error.
Unfortunately the documentation of AppGameKit does not point out that there should be no slash at the end of the string.

Change the project name:
You will need to edit the assembly information.
Right click on Project -> Properties -> Application -> Assembly Information ...
In the field -> Title, you can enter your project name.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 14th Jan 2019 08:41
AGK has always automatically handle it without giving an error, so this is new to me too.

Also, thank you, did not know that was a button...
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 15th Jan 2019 03:01
in basic agk, GetImageExists() returns int 1 or 0

for things like this in AgkSharp, Agk.GetImageExists() returns a uint to match this behavior, but would it be possible to return bool instead?

I get that there is an argument to be made for keeping the AppGameKit behavior, but I'm thinking in this case a bool would be more intuitive and straightforward for AgkSharp users.

What do you yall think?
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 15th Jan 2019 04:08
I was thinking exactly the same thing. At the same time I wanted to stay as close as possible to the original. So I added new commands. All functions that return a boolean value start with Is... .

IsImageExists.

I hope this helps.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 15th Jan 2019 04:52
Oh I see, thanks. I hadn't noticed those commands
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 15th Jan 2019 06:24
There are some more methods I have added. I also overwrote the methods that should get a boolean value.



I also have some enum's inserted.



The associated methods are also overwritten.



If you want to get an enum as return value then you just have to set enum at the end of the method.



Here is the complete list of added methods.



I'm sure I overlooked one method or another. So if you miss a method, please let me know.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 15th Jan 2019 14:49
That's great MadBit, thanks!
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 16th Jan 2019 05:29
Could you program something similar to SetSpriteActive() as SetObjectActive()?
100,000 object with 12 polygon each drop the framerate under 60fps while a single object with 1.2 million polygon does not...

Any idea what kind of processing is AppGameKit doing with object and how to prevent it?

Function that flip bool to prevent those additional processing?
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Jan 2019 05:45 Edited at: 16th Jan 2019 05:50
Have you ever tried SetObjectVisible? It doesn't prevent the geometric calculation but the drawing of the object.

EDIT:
The same to hide parts of an object would be SetMeshVisible.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 16th Jan 2019 06:25 Edited at: 16th Jan 2019 06:53
Even if no polygon is drawn on screen, it still run at under 30fps...
So I assume it has something to do with AppGameKit looping to process object...

Hence the request to turn off the object all together like turning off sprite processing as mention in the document.

This could help with scene loading, why did paul not add this in in the beginning?

When a player ender a door, rather then unload the scene, why not just set it to non active.
If the player happen to return to the scene immediately, they would not be caught in an unloading scene and reloading scene event.

If it does not have this, 99.999% of games could not be made with AppGameKit, making it a useless engine!
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Jan 2019 06:56
Sorry, I can't answer that question. You should ask Paul that question.
I can only assume that it is not intended to end any object animation and object physics simulation.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 16th Jan 2019 07:35
Not much of an engine if the developer could not control that aspect of their game...

Like a 3d plane portal is not a physic object, it just look cool with animation and appear in the world for player at the time, to step into.
So turn off physic for that object.
But that only save 3 fps at best.
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 16th Jan 2019 11:32 Edited at: 16th Jan 2019 11:54
Agk.CreateMemblockFromObjectMesh give another memory access violation...
On main threads

EDIT: tested in tier 1, the same code work fine...
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Jan 2019 12:16
Can you describe it a bit more detailed I did a quick test and ran everything without any problems.


Relating to the previous topic.
I have taken a closer look at the render/update process. If an object is set to not visible and no RidgetBody and Skeleton is present. Then the objects are not drawn and no physics or animation update is done.
The only thing that is time consuming is that all objects are run through and checked - does it have a skeleton? does it have a RidgedBody? is the object visible?
Theoretically it should be possible to remove an object from the RenderList if the object is set to not visible and relink it if it is set to visible (of course under consideration of the skeleton and RidgetBody). I have no idea what effect this would have on the performance or the stability of the engine. But this should be done by Paul.

It's just a thought.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 16th Jan 2019 12:48
Any engine is going to struggle with 100k full objects. Have you tried using instancing?
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 16th Jan 2019 12:58 Edited at: 16th Jan 2019 13:13
NVM, not sure what I did, but it is fix now... Sorry!

As for instancing... Agk function are not threads safe?
...But it still work, just object popping into existence right before you eyes!
...and falling out of the world when it is not loaded...

It was fun...

Also, there is too many object, a table full of stuff for example, the game will lag for like half a seconds.

Attachments

Login to view attachments
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 16th Jan 2019 13:41
Quote: "As for instancing... Agk function are not threads safe?"


Nothing to do with threading, it's a technique which makes shallow copies of objects by sharing basic data instead of creating a new full object, it is a built in command:

https://www.appgamekit.com/documentation/Reference/3D/InstanceObject.htm
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Bored of the Rings
14
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 17th Jan 2019 10:02
just having another look at this, downloaded and copied over templates to my onedrive area under mydocuments. run vs2017 and no templates showing. how odd, will have a closer look at some point.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 17th Jan 2019 13:20
Yeah, I can't get them to show as templates either. You can just load it as a project then export as a template though, seems to work
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Bored of the Rings
14
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 17th Jan 2019 14:08
yes, this is what I did in the end. thanks Ortu. And thanks to Madbit for this, will be very useful for work and outside work activities.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 20th Jan 2019 08:49 Edited at: 20th Jan 2019 08:50
Did you claim that Agk.OpenToRead and Agk.OpenToWrite use File?
Has it been made thread safe?
The moment I put it into a thread, it crashed...

It claim stuff like the file does not exists and such...

Any help apprieciated!
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 20th Jan 2019 16:34
It's not thread safe. The agk commands are going to read from the media folder and write to the appdata folder same as normal I believe. You might as well just use the .net commands for file handling though
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 22nd Jan 2019 04:03
I heard the new agk update will include async for opentoread and opentowrite which run on another thread.
In the end, we end up using File in thread.

Also, I know it is not to topic, but do you know a way to send a variable to a thread without it losing the original variable data in like a for loop?
Thread thread = new Thread(() => function(x,y,z));
By the time the thread start, x and y and z is no longer the same.
Using another thread to start a thread with sleep to offset this.
Any help appreciated!
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 22nd Jan 2019 06:21
Chmava wrote: "I heard the new agk update will include async for opentoread and opentowrite which run on another thread.
In the end, we end up using File in thread."

Do you mean the last update with the command ExtractZipASync? This only applies to unpacking a file. Not opening/closing or reading/writing a file.
But maybe you have other information.

Chmava wrote: "Also, I know it is not to topic, but do you know a way to send a variable to a thread without it losing the original variable data in like a for loop?
Thread thread = new Thread(() => function(x,y,z));
By the time the thread start, x and y and z is no longer the same.
Using another thread to start a thread with sleep to offset this.
Any help appreciated!"

My experience in thread programming isn't that great. Although I don't think you can explicitly send a variable to a running thread. But the thread can read variables from somewhere else.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 22nd Jan 2019 12:33
For clarification, I have written a small example program.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
6
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 9th Feb 2019 13:49
Any news about AppGameKit 2019.18.01 in C#?

Thank you!
www.alexmatei.com
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 24th Feb 2019 21:29
Sorry for the late answer. But I had a lot to do - job, private and HOBBY (this project).
But now a new update.

Include the AppGameKit Update 2018.01.18 and 2018.02.18

- FIX In Linux version - wrong default read/write path.

- ADD AGKVector2 operator '==' and '!=' Methods overwritten 'Equals' and 'GetHashCode'
- ADD AGKVector3 operator '==' and '!=' Methods overwritten 'Equals' and 'GetHashCode'
- ADD AGKVector4 operator '==' and '!=' Methods overwritten 'Equals' and 'GetHashCode'
- ADD AGKQuaternion operator '==' and '!=' Methods overwritten 'Equals' and 'GetHashCode'
- ADD AGKVector2 setters (AGKVector2 Set(float v0, float v1); AGKVector2 Set(AGKVector2 v); AGKVector2 Set(AGKVector3 v); AGKVector2 Set(AGKVector4 v))
- ADD AGKVector3 setters (AGKVector3 Set(float v0, float v1, float v2); AGKVector3 Set(AGKVector2 v, float v2); AGKVector3 Set(AGKVector3 v); AGKVector3 Set(AGKVector4 v))
- ADD AGKVector4 setters (AGKVector4 Set(float v0, float v1, float v2, float v3); AGKVector4 Set(AGKVector2 v, float v2, float v3); AGKVector4 Set(AGKVector3 v, float v3); AGKVector4 Set(AGKVector4 v))

Download from here

If there's a problem, let me know.

Thank you for your support.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
6
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 26th Feb 2019 19:54
Totally understandable!

Thank your for the awesome work!

I'll keep in touch if something comes up!
www.alexmatei.com
Overlord
12
Years of Service
User Offline
Joined: 24th Oct 2006
Location: Germany
Posted: 15th Mar 2019 16:35 Edited at: 15th Mar 2019 16:36
I have problems downloading the files.

After many tries I got them except the Examples_20180707.zip. That file always stops downloading at around 20 MByte.

Even tried different ISPs on my site no luck.

Can someone fix the site or provide alternative DL locations?

Maybe the USB2.0 stick hosting the files is defect SCNR

Thx
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Mar 2019 08:06 Edited at: 16th Mar 2019 08:07
Quote: "Maybe the USB2.0 stick hosting the files is defect SCNR "

Yes, the speed is very bad. I think I'll switch completely to itch.io to distribute this library. When I find time to do that. Programmig is much more fun than maintaining/creating a website.

But in the meantime you can download the examples here.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Attachments

Login to view attachments
Overlord
12
Years of Service
User Offline
Joined: 24th Oct 2006
Location: Germany
Posted: 16th Mar 2019 13:24
Thx @MadBit. Finally got it from here.

Kudos
Zigi
10
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 23rd Mar 2019 09:59 Edited at: 23rd Mar 2019 10:01
Quote: " I think I'll switch completely to itch.io "

I was suggesting this long time ago also because itch.io become a very popular platform for people to start distributing their projects in development phase, get feedback and also to collect donations and move to Steam after.
I also see many projects that don't even have their own home page but rely 100% on itch.io for hosting and also for community as you can also setup a forum for your projects.
As a user, gamer and developer I personally also consider itch.io my no1 platform for buying content. It is a fantastic platform I would even recommend to TGC to use.

You can choose donations/purchases go directly to you or collected by itch.io but either case you can choose how much revenue share you pay to itch.io and you can set it to 0 like for real. itch.io is happy to host your projects and process your payments completely FREE.
The only catch is, obviously they need to set limits how much you can upload and I believe it is 20 projects and 10 files / project and 700MB / file I guess but if you share quality content they are happy to give you as much space as you need to host the project on itch.io. They only want to avoid people start hosting lot of garbage on their platform in the first place but they are happy to host quality content of any size for free.

It would be perfect for AGKSharp, could also help to make more people discover it and provide a real home for the project with a place to have discussions, donate, download, get updates, you could even do a dev blog there.
Could have been useful to have it on itch.io from day 1 as I was suggesting, but better later than never. I highly recommend it.
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 24th Mar 2019 09:19
I would like to know the write to file protocol behaviour for c# version of AGK.

In tier 1, the behaviour is to immediately write to the file on any of the write call, example being WriteLine();
In c#, this seems to be store in ram until closefile() is being called?

Is this correct?

If so, this is bad as I am writhing over 1 tb per file per program as a simulation.

Any advice is appreciated!
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 24th Mar 2019 20:29
When you use the functions of AppGameKit, the behavior should normally be the same as in Tier1.
Personally, I recommend using the C# commands for file operations. That would be better with the large amounts of data you use.
With these commands, the behavior is as you described it. 'Write' writes the data into the stream buffer which is only completely written when the file is closed. But you can also use Flush() to force the emptying/writing of the buffer.

Here is an example from the Microsoft website.


If you want to force the emptying of the buffer you have to use the command file.Flush after the file.WriteLine.

I hope this helps a little.

@Zigi
Thank you again for pointing that out. I must have repressed that.

Then I will have to spend some time to create a page there.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Kyle873
User Offline
Joined: 21st Mar 2019
Location: Ontario, Canada
Posted: 24th Mar 2019 20:51 Edited at: 24th Mar 2019 22:04
This is an absolute godsend, thank you so much for making this! I've been working with C# for well over 10+ years now so this is my comfort zone. The ease of use of both AppGameKit and C# coming together is great! I've spent such a long time trying to find a code-based 2D/3D engine that isn't a pain to work with in C#, and I think I've finally found it. I'm going to execute a small project on this and see how it turns out usability wise. So far though, my hopes are high. There are just a few things I've noticed that could warrent some looking into:

The EKey enum uses UPPER_CASE style naming instead of PascalCase. The enums in general shouldn't have the prefixing E either, so as to conform to the .NET naming standard. I will concede that there may be a good reason that you named them this way though.

SetSpriteShape() doesn't have an overload that takes ESpritePhysicsShape, nor does there seem to a way to set the shape on an AgkSprite instance "nicely" without passing it's SpriteID to a normal SetSpriteShape() call.

I assume the plan is to create more classes like AgkSprite and AgkImage which nicely encapsulates functionality as you develop the wrapper, such as AgkSound and AgkMusic, etc?

Also, here's the relevant bit on naming Enums: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#naming-enumerations

edit:
I think I found another problem and I'm not sure if it's me misunderstanding usage or what. SpriteID isn't set to a sprite index when an AgkSprite class is instantiated, that means if I need to use raw AppGameKit commands on that sprite, I can't do so. In the given example you only call commands which have already been encapsulated via AgkSprite, but in my case, where I want to call Agk.SetSpriteShape(), I can't.
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 25th Mar 2019 04:06 Edited at: 25th Mar 2019 07:14
I mean Agk.WriteLine(); function
Could you reprogram agksharp to behave like tier 1 for all Agk.OpenToWrite() function?
Maybe append a '2' for custom function that has this behaviour?
Kyle873
User Offline
Joined: 21st Mar 2019
Location: Ontario, Canada
Posted: 25th Mar 2019 06:15
Some more stuff I found:

There's no constructor for AgkImage that takes a (szFile, scaleX, scaleY, cache), which you can do with Agk.LoadImageResized(). I see that you can call image.LoadResized() after an initial empty constructor call to create the object but that's an extra line that I think can be avoided with an extra constructor.

There's no way to set a TTF font on an AgkText and it also has no text index exposed so that it can be manually passed to Agk.SetTextFont() to be done that way.

I think in general, all AppGameKit IDs should be exposed by encapsulation classes so that someone doesn't get show-stopped like I am right now by a specific function or property not being implemented in the encapsulated class. I know AgkSprite.SpriteID is there but it seems to be bugged at the moment, as it never gets set. With the wrapper being closed-source, there's nothing I can really do at the moment. I could just manage my own sprite and text class to work around the missing functionality but that kinda defeats the point of battle-testing the wrapper and seeing what works and what still needs to be implemented/fixed.
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 25th Mar 2019 12:23
@Chmava
To be honest, AgkSharp works just like Agk in Tier 1 because the same functions are called internally.
There is not much I can change. I created a small test in Tier1. There I noticed that the data is written only when closing the file.

With that I tested it.


@Kyle873
Agk.CreateSprite(SpriteID, ImageID)
Creates a sprite from the Image ImageID with the ID specified in SpriteID.

Agk.CreateSprite(ImageID)
Creates a Sprite from the Image ImageID and returns the next free SpriteID from index 100000.

Both commands create sprites that are managed internally by a manager. This is the usual way for Agk-Tier1 users.
They also have no other choice.

With Tier 2 or AgkSharp you still have the possibility to create your sprites with AgkSprite.
AgkSprite MySprite = new AgkSprite(image); ect.

The disadvantage of this method is that the sprite manager doesn't notice this and you have to manage your sprite yourself.
Therefore no ID will be created.
Which is not always good.
If you want the sprite manager to manage your sprite and you still want to address your sprite via the class.
This is the only way.

First create a sprite over Agk usual way.
Agk.CreateSprite(1, imgID)

Then get the sprite pointer and use it to create your AgkSprite object.
AgkSprite MySprite = new AgkSprite(Agk.GetSpritePtr(1));

With the AgkSprite class I did not encapsulate the standard sprite commands.
I just wrapped the classes provided by Tier2.
This currently applies to AgkSprite, AgkImage and AgkText.

That brings us to the first of your problems. In the C++ class the SpriteShape is set via an enum this enum is marked as private in the c++ class.
Therefore I don't have free access to set the shape. But I think I have discovered a solution for this recently.

As the standard AppGameKit function for setting the shape does not accept enum values is bad. I must have overlooked that.
I'll do that later. Thanks for the hint.

For AgkImage to include a constructor to load scaled images makes sense. I'll write that on my Todo List .



Thanks for trying AgkSharp. And welcome to the Forum.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 25th Mar 2019 13:23
Its fine, It is a bit slower, but I have to have the file open and close for every single information.
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 25th Mar 2019 22:07 Edited at: 25th Mar 2019 22:12
Just use File.AppendText or batch it out periodically with File.AppendAllText

Just because you can do something with an agk method doesn't mean you need to
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Kyle873
User Offline
Joined: 21st Mar 2019
Location: Ontario, Canada
Posted: 26th Mar 2019 12:26
I've ultimately decided to avoid using AgkImage, AgkSprite and AgkText and to manage things myself. That's working out much better for me and is giving me more control to call, control and encapsulate the way I want to. It also avoids the situation of a wrapper class not exposing the functionality or property I might need.

Also, some more stuff I found:

The ESpritePhysicsShape enum is defined in the wrong order. This one was really throwing me for a loop until I decompiled the wrapper and saw the issue.

Agk.PlayMusicOGG() has no overload which takes a bool for looping.

Agk.SetDefaultMin/MagFilter() has no overload which takes EMinMagFilter.

There is no Agk.IsSpriteInScreen() equivalent function for Agk.GetSpriteInScreen().
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 26th Mar 2019 13:01
Quote: "The ESpritePhysicsShape enum is defined in the wrong order. This one was really throwing me for a loop until I decompiled the wrapper and saw the issue."

That's very odd. In the cSprite class, the enum is enumerated in exactly the same way. In the source-code of SetSpritePhysicsShape circle and box are swapped. But no matter, it will be corrected.
For this, a big thank you.

Quote: "Agk.PlayMusicOGG() has no overload which takes a bool for looping.

Agk.SetDefaultMin/MagFilter() has no overload which takes EMinMagFilter.

There is no Agk.IsSpriteInScreen() equivalent function for Agk.GetSpriteInScreen()."

Are now on the todo list. Thank you again.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 28th Mar 2019 08:02
That is true, but I did not know what variable or system function it was using before, there is no document for it.

Also, could you create a template for android c# visual studio development?
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th Mar 2019 10:28
Hi MadBit, I thought you might be interested that I am using this for a "proof of concept" for a new part of the software company I work for and it is working well in a Windows Forms standalone project. I can't share publicly what I am working on but wanted you to know how well it is working!
If I have any requirements I will ask but it is working well as an interactive panel in all respects except for catching keystrokes and mouse interaction. I am having to deal with these using standard .NET methods of picking them up. Is there anything that can be done to improve this? Actually for my project it is fine to catch them in the form rather than via AppGameKit but it might be useful for some to catch them using the (simpler) AppGameKit commands.
Using AppGameKit V2 Tier 1
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 28th Mar 2019 11:48
@baxslash
That's great and I'm very happy about it.

Can you explain to me what exactly doesn't work? I had worked on it with MateiSoft a few months ago and I think I was able to fix everything so far.
The only disadvantage is if I remember correctly. That the keyboard and mouse only work when the Agk output panel is active. So the mouse pointer is in the panel.

@Chmava
Sorry but from Android / mobile development, I have no experience. I am more the desktop guy.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2019-10-16 06:59:19
Your offset time is: 2019-10-16 06:59:19