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; }
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();*/ }
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); }
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()); }
public static LFont GetDefaultFont() { if (defaultFont == null) { defaultFont = GetFont(18); } return(defaultFont); }
public static LFont GetDefaultFont() { if (defaultFont == null) { defaultFont = GetFont(18); } return defaultFont; }
public static void SetDefaultFont(LFont font) { if (staticFont != null) { staticFont = null; } staticFont = font; }
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(); }
public LFont(LFont font) { this.faceName = font.faceName; this.style = font.style; this.fontSize = font.fontSize; }
public void LoadDefaultFont(LFont font) { LFont.SetDefaultFont(font); }
public LNLabel() { this._type = LabelType.TEXT_ALIGNMENT_LEFT; this._spriteFont = LFont.GetDefaultFont(); this.SetNodeSize(1, 1); }
public static LFont GetFont(int size) { return(LFont.GetFont(LSystem.FONT_NAME, 0, size)); }
public void SetFont(LFont font) { this.font = font; }
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); }
public static LFont GetTrueFont() { return(LFont.GetFont(LSystem.FONT_NAME, 0, realsize)); }
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)); }
public void SetFont(LFont f) { this.font = f; }
public void ResetFont() { this.font = LFont.GetDefaultFont(); this.ResetColor(); }
public Font_Updateable(LFont f) { this.font = f; }
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); }
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(); }
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); }
public void SetFont(LFont f) { this.font = f; if (font != null) { useFont = true; } else { useFont = false; } }
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); }
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; } }