Irrlicht in JScript

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
ErUs
Posts: 165
Joined: Thu Oct 07, 2004 6:13 pm

Irrlicht in JScript

Post by ErUs »

Code: Select all

import System;

import Irrlicht;
import Irrlicht.Video;
import Irrlicht.Core;
import Irrlicht.Scene;

class Cool
{	
	
	function Init() {
		var device:IrrlichtDevice = new IrrlichtDevice(DriverType.OPENGL);
		device.WindowCaption = "Hello Moto!";
		
		if( device.Run() == false ) return;
		
		System.Console.WriteLine( "Irrlicht version " + device.Version );		
		device.ResizeAble = true;
		
        device.CursorControl.Visible = true;
	
		device.GUIEnvironment.AddStaticText( "Irrlicht with JScript!", new Rect( 0, 0, 640, 480), false, true, null, 1 )	
		device.GUIEnvironment.AddMessageBox( "JScript!", "Irrlicht loves .net and JScript :P", false, null, null, 2 );
				
		var shade = 0; var shadev = 1;		
		
		while( device.Run() ) {
		
			if( shade > 250 ) shadev = -1;		
			if( shade < 5 ) shadev = 1;
			
			shade += shadev;
		
			device.VideoDriver.BeginScene(true, true, new Color(0, shade, shade, shade));

			device.GUIEnvironment.DrawAll();
			device.VideoDriver.EndScene();
		
		}		
				
	}
	
}

var meh = new Cool;

meh.Init();
Compile with:
jsc /out:js/test.exe /reference:js/Irrlicht.NET.dll js/test.js
:D

ps. cant get it to load meshes/textures without crashing on me yet
ErUs
Posts: 165
Joined: Thu Oct 07, 2004 6:13 pm

Post by ErUs »

I made it a clone of the other Hello World examples

you can find it here
Locked