|
C# wrapper 2.0 - RELEASE
#344240
10/15/10 13:49
10/15/10 13:49
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
I'm proud to finally release an updated version of the C# wrapper for Acknex. this version features, compared to the old c# wrapper, the following features (thanks to the many suggestions in the C# wrapper - REALESE thread) : - no more var variables, only doubles or int - no more NativeSTRING only normal string - functions and variables are now commented - works without unsafe code (no more allowing of unsafe code) - a more object oriented approach etc... download the wrapperor visit the homepage for some tutorials and how to use the wrapper ! P.S.: oh and if anyone got more suggestions or notices any bugs, don't hesitate to post them here !
Last edited by Stromausfall; 10/16/10 21:19.
|
|
|
Re: C# wrapper 2.0.1 - RELEASE
[Re: 3dgs_snake]
#344266
10/15/10 17:55
10/15/10 17:55
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
a new version of the wrapper, some flags and some documentary was missing... download the wrapper 2.0.1
Last edited by Stromausfall; 10/15/10 17:56.
|
|
|
Re: C# wrapper 2.0.2 - RELEASE
[Re: Joozey]
#344369
10/16/10 21:13
10/16/10 21:13
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
and again a new version ^^ fixed a bug where assigning EngineObjects to some EngineVar variables didn't work here's the new version : wrapper 2.0.2
Last edited by Stromausfall; 10/16/10 22:01.
|
|
|
Re: C# wrapper 2.0.1 - RELEASE
[Re: ventilator]
#344384
10/16/10 22:51
10/16/10 22:51
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
@ventilator, here's an example from the homepage.. the lambda usage still seams a bit awkward but without a doubt much better than the var solution (thanks again ^^)
using System;
using System.Collections;
using AcknexWrapper;
namespace panelExampleTwo
{
class Program
{
private static PANEL testPanel = null;
private static FONT testFont = null;
private static BMAP background = null;
private static BMAP knob = null;
//the main method, called by the scheduler
private static IEnumerable myMainMethod()
{
double dummyVariable = 0;
//create an empty panel
testPanel = PANEL.pan_create(null, 0);
//make the panel visible
testPanel.SHOW = true;
//create a font
testFont = FONT.font_create("Arial#40");
//display the dummyVariable
testPanel.pan_setdigits(
0,
200,
400,
"dummyVariable = %2.f",
testFont,
1,
() => dummyVariable);
//create a background
background =
BMAP.bmap_createblack(200, 50, 128);
//create a knob
knob =
BMAP.bmap_createblack(25, 25, 32);
//make the knob white
knob.bmap_fill(
new Color(255, 255, 255), 100);
dummyVariable = 75;
//create a slider which sets the dummyVariable
testPanel.pan_setslider(
0,
50,
50,
background,
knob,
0,
100,
(double x) => dummyVariable = x,
null);
//activate mouse
EngVar.mouse_mode = 4;
yield return 1;
}
static void Main(string[] args)
{
//open the engine
EngFun.engine_open(null, null);
//create/load an empty level
EngFun.level_load(null);
//start the scheduler
Scheduler.StartScheduler(myMainMethod);
}
}
}
Last edited by Stromausfall; 10/16/10 22:53.
|
|
|
Re: C# wrapper 2.0.1 - RELEASE
[Re: Stromausfall]
#344436
10/17/10 12:10
10/17/10 12:10
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
nice, that's a huge improvement! what i still would change is this: testPanel = PANEL.pan_create(null, 0); testPanel = new Panel(null, 0); but that's a rather small thing... edit: and for the method names i would leave away the prefixes like pan_.
|
|
|
|