0 registered members (),
668
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: C# wrapper 2.0 - RELEASE
[Re: Stromausfall]
#401087
05/13/12 12:20
05/13/12 12:20
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
Thought as much. I had started doing that(transcribe/rewrite the effect to/in c#. ), then came across the matrix problem. I probably will get back to it sooner or later. I am doing so many things at once, plus living as well.
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: C# wrapper 2.0 - RELEASE
[Re: jenGs]
#402303
06/02/12 11:30
06/02/12 11:30
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
Something like this (a button with events that are triggered) ? Or something else ?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AcknexWrapper;
namespace ButtonExample
{
class Program
{
private static BMAP button1On;
private static BMAP button1Off;
private static BMAP button1Over;
private static PANEL mainPanel;
private static IEnumerable<ScheduleMethod> buttonClick(double p)
{
Console.Write("button clicked");
yield break;
}
private static IEnumerable<ScheduleMethod> buttonLeave(double p)
{
Console.WriteLine("mouse left button");
yield break;
}
private static IEnumerable<ScheduleMethod> buttonOver(double p)
{
Console.WriteLine("mouse is over the button");
yield break;
}
private static void CreatePushButton()
{
// create BMAPS for button (and change their color)
Program.button1On =
BMAP.bmap_createblack(200, 200, 32);
Program.button1Off =
BMAP.bmap_createblack(200, 200, 32);
Program.button1Over =
BMAP.bmap_createblack(200, 200, 32);
Program.button1On.bmap_fill(new Color(200, 0, 0), 100);
Program.button1Off.bmap_fill(new Color(100, 0, 0), 100);
Program.button1Over.bmap_fill(new Color(150, 0, 0), 100);
// create a button in the panel
Program.mainPanel.pan_setbutton(
0,
1,
50,
50,
Program.button1On,
Program.button1Off,
Program.button1Over,
Program.button1On,
Program.buttonClick,
Program.buttonLeave,
Program.buttonOver);
}
//the main method, called by the scheduler
private static IEnumerable<ScheduleMethod> myMainMethod()
{
// create the main panel and make it visible
Program.mainPanel =
PANEL.pan_create(null, 1);
Program.mainPanel.SHOW = true;
Program.mainPanel.size_x = EngVar.screen_size.x;
Program.mainPanel.size_y = EngVar.screen_size.y;
// Shows how to create a simple push button and assign functions to it
Program.CreatePushButton();
// use mouse !!
EngVar.mouse_mode = 4;
yield break;
}
static void Main(string[] args)
{
//open the engine
EngFun.engine_open(null, null);
//start the scheduler
Scheduler.StartScheduler(myMainMethod);
}
}
}
|
|
|
Re: C# wrapper 2.0 - RELEASE
[Re: Stromausfall]
#402514
06/06/12 14:34
06/06/12 14:34
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
a new version was uploaded (for Acknex 7.85.4 AND Acknex 8.30.4) the update of the wrapper includes: - changing Scheduling of method now also possible without a previous "yield return 1" – big thanks to Timothy and pararealist here's the link: AcknexWrapper_2_3_9_FOR_8_30_4_AND_7_85_4.zip
|
|
|
Re: C# wrapper 2.0 - RELEASE
[Re: pararealist]
#432560
11/08/13 10:45
11/08/13 10:45
|
Joined: Apr 2006
Posts: 159 Latvija
Arrovs
Member
|
Member
Joined: Apr 2006
Posts: 159
Latvija
|
I have small question. Engine objects like PANEL, TEXT and others gets managed by garbage collector or i need to remove them myself still, when usign C# and this wrapper.
Arrovs once will publish game
|
|
|
|