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
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 28th Mar 2019 17:01
Visual studio c# android development environment.
It's build in and use the same c#.
You just need to use their template to make a template like normal?
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 28th Mar 2019 20:55
Unfortunately, it's not that simple. For the normal AgkSharp.dll this would work. But the AgkWrapper.dll has to be created differently. This is the C++ bridge to C#. It would have to be created similar to creating an Android app with the c++ templates of AppGameKit. Instead of an exe a .so (shared library) must be created.
I looked at the templates and I don't really understand them. It's too much Java for me with what I have no clue about.
I also lack the time to deal with it intensively.
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: 6th Apr 2019 04:32
Hello, I have a new update for you. With some new features. I thank Kyle873 for the suggestions and hints.

The downloadwebsite hasn't changed. But the files themselves are now on a different server.
I hope now that the download is faster and more stable.

Here is an overview of the changelog

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Apr 2019 09:01
Hi MadBit, I am trying to use a sprite shader (just basic for testing) and I am getting a stack overflow when it tries to draw the sprite.
Shader code:

I am just loading it as a sprite shader and applying it to a sprite using Agk.LoadSpriteShader and Agk.SetSpriteShader.
This is for work so any help would be greatly appreciated!
Using AppGameKit V2 Tier 1
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 14th Apr 2019 17:07
Hmm, can you give me more information or code? I've done a quick test and everything is going fine. I used your shader code.

Maybe there is a problem with the .ps text file (format)? In the attachment is the ps file as I used it.

This is the code as I tested it. Maybe I missed something?

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Apr 2019 09:06
Thanks for testing MadBit, I ended up coming up with a better method (if a little slower) of improving my gfx.
I have a feeling I may have been using a full path for the filename rather than a relative path. This might have been the cause but I was getting a valid uint returned for the shader ID.
Anyway the software is really coming on now. I would love to show you a video (maybe in a PM) so you can see what I've been working on.
Maybe once I have the exported data importing properly into our main software I will create an end to end demo.
Using AppGameKit V2 Tier 1
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Apr 2019 10:07
I would like to see what you've achieved with AgkSharp.
Something like that motivates me.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Apr 2019 11:58
Sent you a PM
Using AppGameKit V2 Tier 1
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Apr 2019 13:49
Thank you.
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: 20th Apr 2019 10:10 Edited at: 20th Apr 2019 10:14
Agk.SetTextFont does not work.
Not sure if it is Agk.LoadFont() or just that.

The same code work in tier 1.

Could you check it out?

Agk.LoadFont(1, "/media/font/ARIALUNI.TTF");
Agk.CreateEditBox(1);
Agk.SetEditBoxPosition(1, 500f, 500f);
Agk.SetEditBoxFont(1, 1);
Agk.SetEditBoxText(1, "包要干什么");

Attachments

Login to view attachments
Chmava
6
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 22nd Apr 2019 02:38
bump?
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 22nd Apr 2019 07:23
I'm sorry. It's Easter. Much to do and celebrate with the family.

And I had to narrow down the problem first.

I figured out after several tests what's wrong. I've found that the same bug also occurs in a standard Tier2 project.
I don't know if this is an Agk bug in the core engine or not. If I encode this string by hand into the UTF-8 format it works as it should. I think it has something to do with the UTF-8 encoding in the uString class. It doesn't recognize that there is a Unicode character set and doesn't encode the characters correctly in UTF-8.
From my point of view it's not up to me to fix bugs in the core engine (if it is one).

Perhaps the following function will help you as a workaround

Then your code looks like this.


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: 23rd Apr 2019 03:20 Edited at: 23rd Apr 2019 03:50
So it is indeed a bug?

Also, getclipboard does not return any unicode, instead it just return code 63 for any unicode character while 0-9 and a-z return fine.

Could you confirm?

I end up using the default that came with windows: Clipboard.GetText();
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 23rd Apr 2019 05:45
I'm afraid it is a bug. A closer look into the source code shows me that the data from the clipboard is only processed as standard string. Without checking if it is Unicode.

Quote: "I end up using the default that came with windows: Clipboard.GetText();"

If you use AgkSharp this would be the better choice.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th May 2019 07:57
Agk.GetImageFilename(img) returns an empty string. All I am using is:
Using AppGameKit V2 Tier 1
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
Recently Online
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th May 2019 12:13
Maybe this (from doco)
Quote: "This does not immediately capture the image, depending on the platform your app may continue running in the background whilst the user is choosing an image, or it may pause execution whilst the image is chosen. In any case you must assume your app continues running but is no longer visible, use IsChoosingImage to check when the user returns from the image choosing process, and GetChosenImage to discover the result of the process."
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th May 2019 11:19 Edited at: 17th May 2019 12:20
Ich denke blink0k hat recht. Ich habe das Beispiel aus der Dokumentation in AgkSharp umgesetzt, aber nicht getestet. Vielleicht hilft das weiter.


EDIT:
I've tested it now. It works like this. I also tested it without the while loop. and it works the same way.
You just have to get the selected image with GetChosenImage. But I still think it's safer if you keep the while loop.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th May 2019 15:52
Thanks guys, that would fix it alright! I already built a workaround but I'll try to remember this in future.
Using AppGameKit V2 Tier 1
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
Recently Online
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th May 2019 23:37
It might be a good idea to set a state and check across sync() frames. That tight loop might churn a bit of battery (Just guessing)
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 6th Jun 2019 21:42
Did you get approval to continue on AppGameKit Studio as they allow for Python as well?
See: https://forum.thegamecreators.com/thread/221811#msg2640622
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 6th Jun 2019 21:57 Edited at: 6th Jun 2019 21:58
Python was greenlit to update with classic not studio. C# already had this permission and this only brought python up to par as it had fallen well behind

Quote: "
and can keep itself updated to the latest AppGameKit Classic releases."
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: 7th Jun 2019 12:23 Edited at: 7th Jun 2019 13:32
Just like Ortu said. Nevertheless, at the same time as Adambiser (AGK for Phyton), I had received the message that I could continue to hold AGKSharp up to date.

Edit:
The permission is only valid for the classic version.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 8th Jun 2019 01:01
Well that's at least something. Better than nothing. Imho C# is way to popular to let go as an option.
snaidamast
User Offline
Joined: 16th Oct 2018
Location:
Posted: 22nd Jun 2019 15:55
Hi MadBit...

I have been successfully working with your AGKSharp with VS 2019, which, by the way, I finally resolved that installation issue I had written to you about earlier.

I have been able to load a hexagonal-based map-board, created with the Tiled software and started developing the scrolling mechanisms through the use of the WinForms button controls.

My question is though, how does one use the mouse to select areas on the displayed map-board in the screen area?

I have initialized my application in the same manner that you create a new Windows form, inclusive of passing the form's handle to the "Agk.Init()" function.

In addition I have been testing the "Agk.GetPointerPressed()" function but it never recognizes my mouse clicks when I select a point on the displayed map-board.

Can you tell me what I am missing here?

I have been reviewing your sample code but so far everything I have tried to mimic in my own code has not been successful...

Thank you

Steve Naidamast
Sr. Software Engineer
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 22nd Jun 2019 23:13 Edited at: 22nd Jun 2019 23:19
It doesn't recognize that you have clicked or it doesn't recognize what you have clicked on?

I'd recommend handling hardware events for mouse and keyboard, like detecting a click, with the winforms command set rather than the agk.

To get what was clicked, you will want to use agk.getSpriteHit

I've got some additional example code here that you might find helpful

https://forum.thegamecreators.com/thread/223554
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.
snaidamast
User Offline
Joined: 16th Oct 2018
Location:
Posted: 23rd Jun 2019 00:36
Hi Ortu...

Thank you for your reply. As to your first question, the answer would be both (It doesn't recognize that you have clicked or it doesn't recognize what you have clicked on?)

And yes, I have been attempting to use the WinForms Form.MouseDown event to capture the click on the display screen. However, using the AppGameKit GetPointerPressed and GetPointerX functions, I see in both that nothing is returned to either of these functions.

I have been trying to use MadBit's sample "Terrain" project as a guide, which has the the AppGameKit GetPointerPressed and GetPointerX functions within the main "Program.cs" file.

I much prefer VB.NET to C#, though I am fluent in it, so my code snippets are in VB.NET, if you wouldn't mind taking a quick look at them...

My Program.vb



My Core.vb



My Window.vb


Thank you for your help. It is greatly appreciated...

Steve Naidamast
Sr. Software Engineer
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 23rd Jun 2019 05:27
Form_OnMouseDown / MyButton_Click: I have a feeling that the click event may be getting eaten by one of the handlers and doesn't make it through to the other. I'd start with adding some debugging output to see which of these is firing in which order.

It also looks like you are missing the mouse moved handler which passes through the mouse position info to agk:

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.
snaidamast
User Offline
Joined: 16th Oct 2018
Location:
Posted: 23rd Jun 2019 16:58 Edited at: 23rd Jun 2019 17:58
Hi Ortu...

Thank you very much for your suggestions.

I added in a handler for the MouseMove Event and that did the trick for reporting the mouse position when the displayed map-board was selected with the mouse.

However, I notice another minor but annoying issue. It seems that it always takes two mouse clicks to have the information reported. Even when I removed the scroll button and its associated handler from the code temporarily, this issue persisted.

It was one of the first things I noticed when I started my testing but I had put it up to a conflict with the fact that for some reason at that point the mouse positional information was not being reported as I had wanted.

I know this issue is a result of something minor and I believe I ran into it when I was developing with the MonoGame Engine but for the life of me I cannot remember how I may have resolved it.

>>>

In some further testing, I deleted both the message-box and the Agk.Print statements I was using to show the X-position of the mouse position when selecting the screen and replaced them with a Debug statement to show the information in the Immediate window. Now it appears that for every single click the information is reported instead of for what would have been akin to double-clicking on the same position. As a result, at least in these circumstances the mouse-click was being interfered with both the message-box and the Agk.Print statements.

And yet in MadBit's Terrain sample project he is able to display Agk.Print statements without any issues. True, he is doing something different from what I am attempting to accomplish but I do find it somewhat odd that the Agk.Print statement would interfere with a mouse-click in this manner.

Steve Naidamast
Sr. Software Engineer
MadBit
Valued Member
10
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 25th Jun 2019 10:53
Hi, sorry about the late answer. I'm still two weeks on vacation. So I don't have a chance to give reasonable support.

The way I see it you use vb. The templates are unfortunately not on the same level as those of C#. When I'm back home I'll bring them up to date.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2019-06-26 10:31:42
Your offset time is: 2019-06-26 10:31:42