Esempio n. 1
0
        public ChunkElement(int x, int y, int width, int height, WidgetMouseEvent onClick)
        {
            Area = new Rectangle(x, y, width, height);
            RenderRule.SetSize(width, height);
            OnClick += onClick;

            m_Attributes = new byte[TilesTotal];
            m_Tiles      = new byte[TilesTotal][];
            m_Textures   = new Texture2D[TilesTotal][];
            for (int i = 0; i < TilesTotal; i++)
            {
                m_Tiles[i]    = new byte[4];
                m_Textures[i] = new Texture2D[4];
            }
        }
Esempio n. 2
0
        public MetaTile(int index, int x, int y, int width, int height, WidgetMouseEvent onClick, int tiles_width = 2, int tiles_height = 2)
        {
            m_TilesWidth  = tiles_width;
            m_TilesHeight = tiles_height;

            int tilecount = tiles_width * tiles_height;

            m_Tiles    = new byte[tilecount];
            m_Textures = new Texture2D[tilecount];
            m_FlipH    = new bool[tilecount];
            m_FlipV    = new bool[tilecount];

            m_TileIndex = index;
            Area        = new Rectangle(x, y, width, height);
            RenderRule.SetSize(width, height);
            m_OnClick += onClick;
        }