@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 ^^)
Code:
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);
}
}
}