Пример #1
0
        public GLEx(GraphicsDevice device, LFont f)
        {
            GLEx.device = device;
            GLEx.cemera = new GLExCamera(device);
            clipRasterizerState = new RasterizerState() { ScissorTestEnable = true };
            device.RasterizerState = RasterizerState.CullNone;
            device.DepthStencilState = DepthStencilState.None;
            cemera.viewMatrix = cemera.Result;
            if (f == null)
            {
                SetFont(LFont.GetDefaultFont());
            }
            else
            {
                SetFont(f);
            }
            this.xnaClip = new RectBox(LSystem.screenRect);
            this.font = LFont.GetDefaultFont();
            this.innterBatch = new SpriteBatch(device);
            this.rectangle = new Rectangle(0, 0, 0, 0);
            this.postion = new Vector2(0, 0);
            this.color = Color.White;

            WhitePixel = new Texture2D(device, 1, 1, true, SurfaceFormat.Color);
            Color[] pixels = { Color.White };
            WhitePixel.SetData(pixels);
            GLEx.self = this;

            GLEx.gl = new GL();
            GLEx.gl10 = new GL10();

            shape = XNA_GL.LoadGLShape;
        }
Пример #2
0
        public override void OnMain()
        {
            //����LGameĬ����Դ(�����д˲�����LGame���õ�ģ�ⰴť֮�๦���޷�ʹ��)

            XNAFont = new LFont("Content/Fonts", "black", 0, 20);
            LSetting setting = new LSetting();
            setting.fps = 60;
            setting.width = 480;
            setting.height = 320;
            setting.showFPS = true;
            setting.landscape = true;

            Register(setting, typeof(AVGTitle));

            /*

            //����LGameʹ�õ�Ĭ������(�����д˲�����LGameĬ�ϵ�DrawString֮�ຯ���޷�ʹ��(PS:XNAConfig����
            //Ĭ�ϰ�ʱ���ɻ�ò���Ӣ������֧��))
            XNAFont = new LFont("Content/Fonts", "black", 0, 20);
            MaxScreen(480, 320);
            //�趨��ʼ����ĻΪ�������Զ������Ϸ����Ϊ��Ļ��С
            Initialization(true, LMode.Fill);
            //֡��60
            SetFPS(60);
            //��ʾ֡��
            SetShowFPS(true);
            //����Screen
            SetScreen(new AVGTitle());
            //��ʾScreen
            ShowScreen();*/
        }
Пример #3
0
		public Label(LFont font, string label, int x, int y) {
			this.font = font;
			this.label = label;
			this.color = LColor.black;
			this.visible = true;
			this.SetLocation(x, y);
		}
Пример #4
0
 public LNLabel(string text, LNLabel.LabelType type, LFont spriteFont)
     : base()
 {
     this._spriteFont = spriteFont;
     this._type = type;
     SetString(text);
     this.SetNodeSize(_spriteFont.StringWidth(text), _spriteFont.GetHeight());
 }
Пример #5
0
 public static LFont GetDefaultFont()
 {
     if (defaultFont == null)
     {
         defaultFont = GetFont(18);
     }
     return(defaultFont);
 }
Пример #6
0
 public static LFont GetDefaultFont()
 {
     if (defaultFont == null)
     {
         defaultFont = GetFont(18);
     }
     return defaultFont;
 }
Пример #7
0
 public static void SetDefaultFont(LFont font)
 {
     if (staticFont != null)
     {
         staticFont = null;
     }
     staticFont = font;
 }
Пример #8
0
 public override void OnMain()
 {
     //����LGameʹ�õ�Ĭ������(�����д˲�����LGameĬ�ϵ�DrawString֮�ຯ���޷�ʹ��(PS:XNAConfig����
     //Ĭ�ϰ�ʱ���ɻ�ò���Ӣ������֧��))
     XNAFont = new LFont("Content/Fonts", "black", 0, 20);
     MaxScreen(480, 320);
     //�趨��ʼ����ĻΪ�������Զ������Ϸ����Ϊ��Ļ��С
     Initialization(true, LMode.Fill);
     //֡��60
     SetFPS(60);
     //��ʾ֡��
     SetShowFPS(true);
     //����Screen
     SetScreen(new LLKScreen());
     //��ʾScreen
     ShowScreen();
 }
Пример #9
0
 public LFont(LFont font)
 {
     this.faceName = font.faceName;
     this.style = font.style;
     this.fontSize = font.fontSize;
 }
Пример #10
0
 public void LoadDefaultFont(LFont font)
 {
     LFont.SetDefaultFont(font);
 }
Пример #11
0
		public LNLabel() {
			this._type = LabelType.TEXT_ALIGNMENT_LEFT;
			this._spriteFont = LFont.GetDefaultFont();
			this.SetNodeSize(1, 1);
		}
Пример #12
0
 public static LFont GetFont(int size)
 {
     return(LFont.GetFont(LSystem.FONT_NAME, 0, size));
 }
Пример #13
0
 public void SetFont(LFont font)
 {
     this.font = font;
 }
Пример #14
0
 public void DrawString(LFont spriteFont, string text, float px, float py,
         LColor color, float rotation, float originx, float originy,
         float scale)
 {
     LFont old = font;
     if (spriteFont != null)
     {
         SetFont(spriteFont);
     }
     int height = ((spriteFont.GetHeight() - 2));
     if (rotation == 0f)
     {
         DrawString(text, px - (originx * scale), (py + height)
                 - (originy * scale), scale, scale, originx, originy,
                 rotation, color);
     }
     else
     {
         DrawString(text, px, (py + height), scale, scale, originx, originy,
                 rotation, color);
     }
     SetFont(old);
 }
Пример #15
0
 public LFont(LFont font)
 {
     this.faceName = font.faceName;
     this.style    = font.style;
     this.fontSize = font.fontSize;
 }
Пример #16
0
 public static LFont GetTrueFont()
 {
     return(LFont.GetFont(LSystem.FONT_NAME, 0, realsize));
 }
Пример #17
0
        public override void OnMain()
        {
            //����LGameĬ����Դ(�����д˲�����LGame���õ�ģ�ⰴť֮�๦���޷�ʹ��)
            XNAConfig.Load("content/loon.def");
            //���������ļ����˴���Ԥ����õ�xnb�ļ� PS�����Զ�����Դ�ļ�������ΪContentʱ��
            //�������Զ��ͱ�׼��Content�ļ��кϲ�������������ʾ�����Windowsϵͳ�������ļ�
            //����Сд��
            XNAFont = new LFont("content", "black", 0, 20);

            //ע��AD����(��׼XNA�¼�����)
            SetXNAListener(new ADListener());

            //�趨�������
            LSetting setting = new LSetting();
            setting.fps = 60;
            setting.width = 480;
            setting.height = 320;
            setting.showFPS = true;
            setting.landscape = false;
            //ע���ʼScreen
            Register(setting, typeof(ScreenTest));
        }
Пример #18
0
 public void SetFont(LFont f)
 {
     this.font = f;
 }
Пример #19
0
 public void ResetFont()
 {
     this.font = LFont.GetDefaultFont();
     this.ResetColor();
 }
Пример #20
0
 public static void SetDefaultFont(LFont font)
 {
     if (staticFont != null)
     {
         staticFont = null;
     }
     staticFont = font;
 }
Пример #21
0
 public Font_Updateable(LFont f)
 {
     this.font = f;
 }
Пример #22
0
 public void DrawString(LFont spriteFont, string text, Vector2f position,
         LColor color)
 {
     LFont old = font;
     if (spriteFont != null)
     {
         SetFont(spriteFont);
     }
     int heigh = (spriteFont.GetHeight() - 2);
     DrawString(text, position.x, (position.y + heigh), 1f, 1f, 0f, 0f, 0f,
             color);
     SetFont(old);
 }
Пример #23
0
 public void RestoreMatrix()
 {
     if (isDirty)
     {
         cemera.viewMatrix = cemera.Old;
         isDirty = false;
     }
     if (font != null)
     {
         LFont resetFont = LFont.GetDefaultFont();
         if (resetFont != null)
         {
             font = resetFont;
         }
     }
     ResetLineWidth();
     ClearClip();
 }
Пример #24
0
 public void DrawString(LFont spriteFont, string text, Vector2f position,
         LColor color, float rotation, Vector2f origin, Vector2f scale)
 {
     LFont old = font;
     if (spriteFont != null)
     {
         SetFont(spriteFont);
     }
     int heigh = ((spriteFont.GetHeight() - 2));
     if (rotation == 0f)
     {
         DrawString(text, position.x - (origin.x * scale.x),
                 (position.y + heigh) - (origin.y * scale.y), scale.x,
                 scale.y, origin.x, origin.y, rotation, color);
     }
     else
     {
         DrawString(text, position.x, (position.y + heigh), scale.x,
                 scale.y, origin.x, origin.y, rotation, color);
     }
     SetFont(old);
 }
Пример #25
0
 public Font_Updateable(LFont f)
 {
     this.font = f;
 }
Пример #26
0
 public void SetFont(LFont f)
 {
     this.font = f;
     if (font != null)
     {
         useFont = true;
     }
     else
     {
         useFont = false;
     }
 }
Пример #27
0
 public void DrawString(LFont spriteFont, string text, float x, float y,
         LColor color)
 {
     LFont old = font;
     if (spriteFont != null)
     {
         SetFont(spriteFont);
     }
     int heigh = (spriteFont.GetHeight() - 2);
     DrawString(text, x, (y + heigh), 1f, 1f, 0f, 0f, 0f, color);
     SetFont(old);
 }
Пример #28
0
 public void Dispose()
 {
     this.initBatch = false;
     this.isClose = true;
     this.isDirty = false;
     this.useFont = false;
     this.useGLBegin = false;
     if (innterBatch != null)
     {
         innterBatch.Dispose();
         innterBatch = null;
     }
     if (batchSprite != null)
     {
         batchSprite.Dispose();
         batchSprite = null;
     }
     if (shape != null)
     {
         shape.Dispose();
         shape = null;
     }
     if (font != null)
     {
         font.Dispose();
         font = null;
     }
     GLEx.device = null;
     GLEx.cemera = null;
     if (WhitePixel != null)
     {
         WhitePixel.Dispose();
         WhitePixel = null;
     }
 }