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.

Dark GDK .NET / [STICKY] DarkGDK.NET Useful Code Snppets

Author
Message
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 2nd Jan 2010 17:53 Edited at: 9th Apr 2010 09:54
VB.Net - SmoothMatrix (By Silvester)

A rewrite from This. It's easy to use, just enter the Matrix you want to smooth, the max X tiles, Max Z tiles and the amount of times you want it smoothed, and let it do it's job! Enjoy

C# - Keyboard and Mouse events. (By o2q)

Instead of constantly checking whether a key is down or not, these functions check if a key is pressed once and won't read it again until it's released.


EDP Map Editor[2D]
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 12th Jan 2010 02:20 Edited at: 12th Jan 2010 02:24
Nice work Silvester Made sticky to allow other users to post their useful code snippets.

Paul.

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 12th Jan 2010 07:54 Edited at: 12th Jan 2010 07:58
Oooh, nice. A sticky with my name on it.

I've just changed a little mistake I came across while using this code though, the edge calculations always assumed your matrix was 50*50 tiles, I sort of made that system in a rush so I had it sorted out to work for my own test matrix, but never thought of replacing the values with the MaxTileX/MaxTileZ variables! Silly me!

Oh, and the post title says Snppets.

EDIT : I think DarkGDK(Both the .Net & C++ versions) could use a codebase as well.. Wonder why they never added those languages to it yet.. I mean there's plenty of people willing to use the C++ version, and as soon as the .Net version would be easier to find on the site I'm sure more people will use it as well.


EDP Map Editor[2D]
o2q
15
Years of Service
User Offline
Joined: 13th Sep 2008
Location:
Posted: 17th Jan 2010 01:02
Hello,

Here's couple of really simple C# functions for key and mouse events.
Instead of constantly checking whether a key is down or not, these functions check if a key is pressed once and won't read it again until it's released.


Simple yet useful.

I'll post more later
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 9th Apr 2010 09:56
There, added your snippet to the first post as well, and cleaned the post up a little as well.. Hopefully when there's more snippets I can simply add them to that post as well to keep it easy to look through them.


EDP Map Editor[2D]
Frank C
13
Years of Service
User Offline
Joined: 3rd Jul 2010
Location: Houston TX
Posted: 16th Jul 2010 16:38
I converted o2q's key and mouse events code to VB.Net for those not using C#. Thanks o2q this looks like the code I need.

Dotnet DHK
13
Years of Service
User Offline
Joined: 21st Jul 2010
Location:
Posted: 21st Jul 2010 11:16
Great. It will be helpful, Thanks for the sharing.

Antwan
Data recovery software

data recovery

Login to post a reply

Server time is: 2024-04-23 16:58:47
Your offset time is: 2024-04-23 16:58:47