Beispiel #1
0
 public RFONT Create_TextureFont(string FontName, string FileName)
 {
     RFONT font = new RFONT();
     font._name = FontName;
     font._spriteFont = REngine.Instance._content.Load<SpriteFont>(FileName);
     return font;
 }
Beispiel #2
0
        public void Draw_TextureFont(RFONT font, int X, int Y, string Message, R4DVECTOR color, float Rotation, R2DVECTOR RotationOrigin, R2DVECTOR Scale)
        {
            Color c = new Color(color.vector);

            try
            {
                _instance._spritebatch.Begin();
                _instance._spritebatch.DrawString(font._spriteFont, Message, new Vector2(X, Y), c, Rotation, RotationOrigin.vector, Scale.vector, SpriteEffects.None, 0);
                _instance._spritebatch.End();

            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                REngine.Instance.AddToLog(e.ToString());
            }
        }
Beispiel #3
0
 public void Draw_TextureFont(RFONT font, int X, int Y, string Message)
 {
     Draw_TextureFont(font, X, Y, Message, new R4DVECTOR(1f, 1f, 1f, 1f));
 }
Beispiel #4
0
        public void Draw_TextureFont(RFONT font, int X, int Y, string Message, R4DVECTOR color)
        {
            Color c = new Color(color.vector);

            try
            {
                _instance._spritebatch.Begin();
                _instance._spritebatch.DrawString(font._spriteFont, Message, new Vector2(X, Y), c);
                _instance._spritebatch.End();

            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                REngine.Instance.AddToLog(e.ToString());
            }
        }
Beispiel #5
0
        public override void Init()
        {
            #if !XBOX
            this.Reactor.Init3DGame(1280, 720, false);
            #else
            this.Reactor.Init3DGame(180, 720, true);
            this.Reactor.SetXBox360Resolution(CONST_REACTOR_XBOX_RESOLUTION.r720P);
            #endif
            this.Reactor.SetWatermarkPosition(CONST_REACTOR_WATERMARK_POSITION.BOTTOM_RIGHT);
            Reactor.ShowFPS(true);
            Reactor.AllowEscapeQuit(true);
            Reactor.ShowMouse(false);
            //Reactor.SetDebugFile("debug.txt");
            //Reactor.SetDebugMode(true);
            scene = new RScene();
            screen = new RScreen2D();
            textures = new RTextureFactory();
            //lighting = new RLightingFactory();
            //materials = new RMaterialFactory();

            Reactor.Resized += new ViewportResized(Reactor_Resized);
            camera = this.Reactor.GetCamera();
            camera.SetClipPlanes(1f, 180000);
            atmosphere = new RAtmosphere();
            atmosphere.Initialize();
            input = new RInput();
            camera.Position = R3DVECTOR.Zero;
            camera.LookAt(new R3DVECTOR(0.5f,0f,0.5f));
            font = screen.Create_TextureFont("Font1", "Font1");
            //emitter = (RParticleEmitter)scene.CreateNode<RParticleEmitter>("myemitter");
            //emitter2 = scene.CreateParticleEmitter(CONST_REACTOR_PARTICLETYPE.Billboard, "myemitter2");
            landscape = (RLandscape)scene.CreateNode<RLandscape>("myland");
            water = (RWater)scene.CreateNode<RWater>("mywater");
            //mesh = (RActor)scene.CreateNode<RActor>("mymesh");
        }