Subversion Repositories spk

Rev

Blame | Last modification | View Log | RSS feed

#ifndef __RENDERTEXT_H__
#define __RENDERTEXT_H__

#include "Display.h"
#include <spk.h>

class CRenderText : public CRenderObject
{
public:
        CRenderText ( int = 0 );
        ~CRenderText ();

        void SetText ( CyString text ) { m_sText = text; }
        virtual void render ( MyDirect3DDevice9 *device, int x, int y, LPD3DXSPRITE sprite );
        virtual void InitFont ( MyDirect3DDevice9 *device, LPCTSTR fontStr, int size );
        virtual void StartAnimation ( SAnimate *anim );

        virtual bool CheckMouse ( int x, int y, int offsetx, int offsety );
        virtual void SetSize ( int w, int h )
        {
                m_iWidth = w;
                m_iHeight = h;
        }
        virtual void SetSize(int size)
        {
                m_iSize = size;
        }

        void SetAlignment ( int align )
        {
                m_iAlign = align;
        }

        virtual void ParseSetting ( COverlay *, CyString cmd, CyString rest, CyString section );

protected:
        CyString        m_sText;
        int             m_iWidth;
        int             m_iHeight;
        int             m_iAlign;

        bool m_bBreakLine;

        int m_iSize;

        LPD3DXFONT m_font;
};

class CRenderTextHeader : public CRenderText 
{
public:
        CRenderTextHeader ( MyDirect3DDevice9 *device, LPCTSTR fontStr, CyString header );
};

class CRenderTextNormal : public CRenderText 
{
public:
        CRenderTextNormal ( MyDirect3DDevice9 *device, LPCTSTR fontStr, CyString header );
};

#endif //__RENDERTEXT_H__